:root {
      color-scheme: light;
      --bg: #f7f5ff;
      --text: #161828;
      --subtle: #697184;
      --muted: #8a91a3;
      --line: rgba(91, 99, 130, 0.16);
      --panel: rgba(255, 255, 255, 0.82);
      --panel-strong: rgba(255, 255, 255, 0.96);
      --primary: #6d5dfc;
      --primary-strong: #5848f5;
      --primary-soft: rgba(109, 93, 252, 0.12);
      --pink: #ff6fb1;
      --cyan: #00b7d8;
      --warning: #f59e0b;
      --danger: #d92d20;
      --success: #12a35f;
      --shadow: 0 24px 70px rgba(44, 39, 91, 0.16);
      --shadow-soft: 0 14px 36px rgba(44, 39, 91, 0.1);
      --radius-xl: 28px;
      --radius-lg: 22px;
      --radius-md: 16px;
    }

    * {
      box-sizing: border-box;
    }

    html {
      scroll-behavior: smooth;
    }

    body {
      margin: 0;
      min-height: 100vh;
      font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
      color: var(--text);
      background:
        radial-gradient(circle at 8% 12%, rgba(255, 111, 177, 0.20), transparent 28%),
        radial-gradient(circle at 84% 8%, rgba(0, 183, 216, 0.20), transparent 28%),
        radial-gradient(circle at 52% 96%, rgba(109, 93, 252, 0.18), transparent 36%),
        linear-gradient(135deg, #fbfbff 0%, #f4f2ff 48%, #eff9ff 100%);
      overflow-x: hidden;
    }

    body::before {
      content: "";
      position: fixed;
      inset: 0;
      pointer-events: none;
      background-image:
        linear-gradient(rgba(22, 24, 40, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(22, 24, 40, 0.035) 1px, transparent 1px);
      background-size: 48px 48px;
      mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 78%);
    }

    button,
    input,
    select,
    textarea {
      font: inherit;
    }

    button {
      -webkit-tap-highlight-color: transparent;
    }

    .shell {
      position: relative;
      z-index: 1;
      width: min(1240px, calc(100% - 32px));
      margin: 0 auto;
      padding: 34px 0 44px;
    }

    .hero {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 18px;
      align-items: end;
      margin-bottom: 24px;
    }

    .badge {
      display: inline-flex;
      align-items: center;
      width: fit-content;
      gap: 8px;
      margin-bottom: 14px;
      border: 1px solid rgba(109, 93, 252, 0.22);
      border-radius: 999px;
      padding: 8px 12px;
      color: #5144d8;
      background: rgba(255, 255, 255, 0.68);
      box-shadow: 0 8px 24px rgba(109, 93, 252, 0.10);
      font-size: 13px;
      font-weight: 800;
      letter-spacing: 0.02em;
      backdrop-filter: blur(14px);
    }

    .badge-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--primary), var(--pink));
      box-shadow: 0 0 0 5px rgba(109, 93, 252, 0.12);
    }

    h1 {
      margin: 0;
      max-width: 780px;
      font-size: clamp(34px, 5vw, 64px);
      line-height: 0.98;
      letter-spacing: -0.055em;
    }

    .gradient-text {
      background: linear-gradient(120deg, #171829 12%, #6654ff 52%, #ff5ca8 88%);
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
    }

    .subtitle {
      max-width: 660px;
      margin: 16px 0 0;
      color: var(--subtle);
      font-size: 16px;
      line-height: 1.7;
    }

    .hero-card {
      width: 278px;
      border: 1px solid rgba(255, 255, 255, 0.74);
      border-radius: var(--radius-lg);
      padding: 16px;
      background: rgba(255, 255, 255, 0.58);
      box-shadow: var(--shadow-soft);
      backdrop-filter: blur(18px);
    }

    .hero-card-title {
      margin: 0 0 10px;
      color: var(--subtle);
      font-size: 13px;
      font-weight: 800;
    }

    .mini-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
    }

    .mini-tile {
      aspect-ratio: 1;
      border-radius: 14px;
      background:
        linear-gradient(135deg, rgba(109, 93, 252, 0.28), rgba(255, 111, 177, 0.18)),
        #fff;
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
    }

    .mini-tile:nth-child(2) {
      background: linear-gradient(135deg, rgba(0, 183, 216, 0.24), rgba(109, 93, 252, 0.18)), #fff;
    }

    .mini-tile:nth-child(3) {
      background: linear-gradient(135deg, rgba(255, 111, 177, 0.25), rgba(245, 158, 11, 0.18)), #fff;
    }

    .layout {
      display: grid;
      grid-template-columns: minmax(330px, 440px) minmax(0, 1fr);
      gap: 22px;
      align-items: start;
    }

    .panel {
      border: 1px solid rgba(255, 255, 255, 0.74);
      border-radius: var(--radius-xl);
      background: var(--panel);
      box-shadow: var(--shadow);
      backdrop-filter: blur(22px);
    }

    .form-panel {
      position: sticky;
      top: 22px;
      padding: 20px;
    }

    .section-title {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 18px;
    }

    .section-title h2 {
      margin: 0;
      font-size: 18px;
      letter-spacing: -0.02em;
    }

    .pill {
      border-radius: 999px;
      padding: 6px 10px;
      color: #5144d8;
      background: var(--primary-soft);
      font-size: 12px;
      font-weight: 900;
    }

    .field {
      display: grid;
      gap: 9px;
      margin-bottom: 16px;
    }

    .field-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .field label,
    .group-label {
      color: #252b3f;
      font-size: 13px;
      font-weight: 900;
      letter-spacing: 0.01em;
    }

    .counter {
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
    }

    .mode-tabs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-bottom: 16px;
    }

    .mode-option {
      position: relative;
      display: grid;
      gap: 4px;
      min-height: 66px;
      border: 1px solid rgba(91, 99, 130, 0.16);
      border-radius: var(--radius-md);
      padding: 12px 13px;
      background: rgba(255, 255, 255, 0.72);
      cursor: pointer;
      transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
    }

    .mode-option input {
      position: absolute;
      opacity: 0;
      pointer-events: none;
    }

    .mode-option strong {
      color: #252b3f;
      font-size: 14px;
    }

    .mode-option span {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.42;
    }

    .mode-option:has(input:checked) {
      border-color: rgba(109, 93, 252, 0.62);
      background: rgba(109, 93, 252, 0.1);
      box-shadow: 0 0 0 5px rgba(109, 93, 252, 0.1);
    }

    .control {
      width: 100%;
      border: 1px solid rgba(91, 99, 130, 0.16);
      border-radius: var(--radius-md);
      background: rgba(255, 255, 255, 0.84);
      color: var(--text);
      padding: 13px 14px;
      outline: none;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
      transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
    }

    .control:hover {
      background: rgba(255, 255, 255, 0.96);
    }

    .control:focus {
      border-color: rgba(109, 93, 252, 0.62);
      box-shadow: 0 0 0 5px rgba(109, 93, 252, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
      background: #fff;
    }

    textarea.control {
      min-height: 184px;
      resize: vertical;
      line-height: 1.62;
    }

    input[type="file"].control {
      padding: 10px 12px;
    }

    .filepond--root {
      margin: 0;
      font-family: inherit;
      color: var(--text);
    }

    .filepond--panel-root {
      border: 1px solid rgba(91, 99, 130, 0.16);
      border-radius: var(--radius-md);
      background: rgba(255, 255, 255, 0.84);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }

    .filepond--drop-label {
      min-height: 136px;
      color: var(--subtle);
      font-size: 14px;
    }

    .filepond--drop-label label {
      cursor: pointer;
    }

    .filepond--label-action {
      color: #5144d8;
      text-decoration-color: rgba(109, 93, 252, 0.45);
      text-decoration-thickness: 2px;
    }

    .filepond--item-panel {
      background: linear-gradient(135deg, var(--primary), var(--pink));
    }

    .filepond--image-preview-wrapper {
      border-radius: calc(var(--radius-md) - 4px);
      overflow: hidden;
    }

    .filepond--root.filepond--disabled {
      opacity: 0.68;
      cursor: not-allowed;
    }

    .choices {
      margin: 0;
      color: var(--text);
      font-size: 14px;
    }

    .choices[data-type*="select-one"]::after {
      border-color: var(--subtle) transparent transparent;
      right: 16px;
    }

    .choices[data-type*="select-one"].is-open::after {
      border-color: transparent transparent var(--subtle);
      margin-top: -7px;
    }

    .choices__inner {
      min-height: 48px;
      border: 1px solid rgba(91, 99, 130, 0.16);
      border-radius: var(--radius-md);
      background: rgba(255, 255, 255, 0.84);
      color: var(--text);
      padding: 7px 14px;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
      transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
    }

    .choices:hover .choices__inner {
      background: rgba(255, 255, 255, 0.96);
    }

    .choices.is-focused .choices__inner,
    .choices.is-open .choices__inner {
      border-color: rgba(109, 93, 252, 0.62);
      box-shadow: 0 0 0 5px rgba(109, 93, 252, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
      background: #fff;
    }

    .choices__list--single {
      padding: 4px 24px 4px 0;
    }

    .choices__list--dropdown,
    .choices__list[aria-expanded] {
      z-index: 10;
      margin-top: 8px;
      border: 1px solid rgba(91, 99, 130, 0.16);
      border-radius: var(--radius-md);
      overflow: hidden;
      background: var(--panel-strong);
      box-shadow: var(--shadow-soft);
    }

    .choices__list--dropdown .choices__item--selectable,
    .choices__list[aria-expanded] .choices__item--selectable {
      padding-right: 14px;
    }

    .choices__list--dropdown .choices__item--selectable.is-highlighted,
    .choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
      background: var(--primary-soft);
      color: #5144d8;
    }

    .choices.is-disabled .choices__inner {
      opacity: 0.68;
      background: rgba(245, 246, 250, 0.82);
      cursor: not-allowed;
    }

    .settings {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
    }

    .edit-fields {
      display: none;
    }

    .edit-fields.is-visible {
      display: block;
    }

    .actions {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 10px;
      align-items: center;
    }

    .button,
    .tool-button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      min-height: 46px;
      border: 0;
      border-radius: var(--radius-md);
      padding: 0 17px;
      font-weight: 900;
      cursor: pointer;
      transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
      user-select: none;
    }

    .button:active,
    .tool-button:active {
      transform: translateY(1px) scale(0.99);
    }

    .button.primary {
      color: #fff;
      background: linear-gradient(135deg, var(--primary), var(--pink));
      box-shadow: 0 14px 26px rgba(109, 93, 252, 0.28);
    }

    .button.primary:hover {
      box-shadow: 0 18px 34px rgba(109, 93, 252, 0.34);
      transform: translateY(-1px);
    }

    .button.secondary {
      color: #574ddb;
      background: rgba(255, 255, 255, 0.78);
      border: 1px solid rgba(109, 93, 252, 0.18);
    }

    .button:disabled,
    .tool-button:disabled {
      cursor: not-allowed;
      opacity: 0.5;
      box-shadow: none;
      transform: none;
    }

    .result-panel {
      min-height: 682px;
      overflow: hidden;
    }

    .result-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      border-bottom: 1px solid rgba(91, 99, 130, 0.13);
      padding: 16px;
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.34));
    }

    .status {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
      border: 1px solid rgba(91, 99, 130, 0.13);
      border-radius: 999px;
      padding: 9px 12px;
      color: var(--subtle);
      background: rgba(255, 255, 255, 0.72);
      font-size: 13px;
      font-weight: 900;
    }

    .dot {
      width: 9px;
      height: 9px;
      border-radius: 50%;
      background: var(--muted);
      flex: 0 0 auto;
    }

    .status.is-loading .dot {
      background: var(--warning);
      animation: pulse 1s infinite ease-in-out;
    }

    .status.is-success .dot {
      background: var(--success);
    }

    .status.is-error .dot {
      background: var(--danger);
    }

    @keyframes pulse {
      0%, 100% {
        transform: scale(0.9);
        opacity: 0.58;
      }
      50% {
        transform: scale(1.32);
        opacity: 1;
      }
    }

    .result-actions {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 8px;
      flex: 0 0 auto;
    }

    .tool-button {
      min-height: 40px;
      border: 1px solid rgba(91, 99, 130, 0.15);
      border-radius: 999px;
      padding: 0 13px;
      color: #3c4260;
      background: rgba(255, 255, 255, 0.75);
      font-size: 13px;
    }

    .tool-button:hover:not(:disabled) {
      background: #fff;
      box-shadow: 0 10px 24px rgba(44, 39, 91, 0.10);
    }

    .tool-button.download {
      color: #fff;
      border-color: transparent;
      background: linear-gradient(135deg, var(--primary), var(--cyan));
      box-shadow: 0 12px 24px rgba(0, 183, 216, 0.18);
    }

    .history-toggle {
      position: fixed;
      top: 132px;
      right: 18px;
      z-index: 25;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-height: 42px;
      border: 1px solid rgba(109, 93, 252, 0.2);
      border-radius: 999px;
      padding: 0 14px;
      color: #fff;
      background: linear-gradient(135deg, var(--primary), var(--pink));
      box-shadow: 0 16px 34px rgba(109, 93, 252, 0.28);
      font-weight: 900;
      cursor: pointer;
    }

    .history-drawer {
      position: fixed;
      top: 0;
      right: 0;
      z-index: 30;
      display: grid;
      grid-template-rows: auto auto 1fr;
      width: min(360px, calc(100vw - 28px));
      height: 100vh;
      background: rgba(255, 255, 255, 0.92);
      border-left: 1px solid rgba(91, 99, 130, 0.14);
      box-shadow: -24px 0 70px rgba(44, 39, 91, 0.18);
      backdrop-filter: blur(18px);
      transform: translateX(104%);
      transition: transform 0.2s ease;
    }

    .history-drawer.is-open {
      transform: translateX(0);
    }

    .history-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 18px;
      border-bottom: 1px solid rgba(91, 99, 130, 0.12);
    }

    .history-title {
      margin: 0;
      color: var(--text);
      font-size: 16px;
      font-weight: 900;
    }

    .history-count {
      display: block;
      margin-top: 3px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 800;
    }

    .history-close {
      display: grid;
      place-items: center;
      width: 34px;
      height: 34px;
      border: 1px solid rgba(91, 99, 130, 0.14);
      border-radius: 50%;
      color: var(--subtle);
      background: rgba(255, 255, 255, 0.78);
      cursor: pointer;
      font-size: 18px;
      line-height: 1;
    }

    .history-toolbar {
      display: flex;
      gap: 8px;
      padding: 12px 18px;
      border-bottom: 1px solid rgba(91, 99, 130, 0.1);
    }

    .history-action {
      min-height: 34px;
      border: 1px solid rgba(91, 99, 130, 0.14);
      border-radius: 999px;
      padding: 0 11px;
      color: #3c4260;
      background: rgba(255, 255, 255, 0.78);
      font-size: 12px;
      font-weight: 900;
      cursor: pointer;
    }

    .history-action.primary {
      color: #fff;
      border-color: transparent;
      background: linear-gradient(135deg, var(--primary), var(--cyan));
    }

    .history-action.danger {
      color: var(--danger);
    }

    .history-action:disabled {
      cursor: not-allowed;
      opacity: 0.48;
    }

    .history-list {
      overflow-y: auto;
      padding: 14px 12px 18px;
    }

    .history-empty {
      margin: 28px 6px;
      border: 1px dashed rgba(109, 93, 252, 0.2);
      border-radius: 18px;
      padding: 24px 16px;
      color: var(--subtle);
      background: rgba(109, 93, 252, 0.06);
      text-align: center;
      font-size: 13px;
      line-height: 1.7;
    }

    .history-item {
      display: grid;
      grid-template-columns: 22px 88px minmax(0, 1fr);
      gap: 10px;
      align-items: center;
      width: 100%;
      border: 1px solid rgba(91, 99, 130, 0.13);
      border-radius: 16px;
      padding: 9px;
      background: rgba(255, 255, 255, 0.72);
      box-shadow: 0 10px 24px rgba(44, 39, 91, 0.08);
    }

    .history-item + .history-item {
      margin-top: 10px;
    }

    .history-check {
      width: 17px;
      height: 17px;
      accent-color: var(--primary);
    }

    .history-thumb {
      width: 88px;
      aspect-ratio: 4 / 3;
      border: 0;
      border-radius: 12px;
      padding: 0;
      overflow: hidden;
      background: rgba(91, 99, 130, 0.08);
      cursor: pointer;
    }

    .history-thumb img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .history-info {
      min-width: 0;
    }

    .history-info strong {
      display: block;
      overflow: hidden;
      color: var(--text);
      font-size: 13px;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .history-info span {
      display: block;
      margin-top: 3px;
      color: var(--muted);
      font-size: 11px;
      line-height: 1.35;
    }

    .history-download {
      margin-top: 8px;
      min-height: 30px;
      border: 1px solid rgba(109, 93, 252, 0.18);
      border-radius: 999px;
      padding: 0 10px;
      color: #5144d8;
      background: rgba(109, 93, 252, 0.08);
      font-size: 12px;
      font-weight: 900;
      cursor: pointer;
    }

    .preview-wrap {
      padding: 18px;
    }

    .preview {
      position: relative;
      display: grid;
      place-items: center;
      min-height: 536px;
      border: 1px solid rgba(91, 99, 130, 0.12);
      border-radius: 24px;
      overflow: hidden;
      background:
        radial-gradient(circle at 20% 12%, rgba(109, 93, 252, 0.14), transparent 30%),
        radial-gradient(circle at 84% 74%, rgba(255, 111, 177, 0.12), transparent 28%),
        linear-gradient(45deg, rgba(91, 99, 130, 0.07) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(91, 99, 130, 0.07) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(91, 99, 130, 0.07) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(91, 99, 130, 0.07) 75%),
        rgba(255, 255, 255, 0.56);
      background-position: 0 0, 0 0, 0 0, 0 14px, 14px -14px, -14px 0;
      background-size: auto, auto, 28px 28px, 28px 28px, 28px 28px, 28px 28px, auto;
    }

    .preview::before {
      content: "";
      position: absolute;
      inset: 14px;
      border: 1px dashed rgba(109, 93, 252, 0.18);
      border-radius: 18px;
      pointer-events: none;
    }

    .empty {
      position: relative;
      z-index: 1;
      width: min(460px, calc(100% - 32px));
      text-align: center;
      border: 1px solid rgba(255, 255, 255, 0.82);
      border-radius: 24px;
      padding: 30px 26px;
      color: var(--subtle);
      background: rgba(255, 255, 255, 0.76);
      box-shadow: var(--shadow-soft);
      line-height: 1.75;
      backdrop-filter: blur(18px);
    }

    .empty-icon {
      display: grid;
      place-items: center;
      width: 58px;
      height: 58px;
      margin: 0 auto 14px;
      border-radius: 20px;
      color: #fff;
      background: linear-gradient(135deg, var(--primary), var(--pink));
      box-shadow: 0 16px 32px rgba(109, 93, 252, 0.24);
      font-size: 26px;
    }

    .empty strong {
      display: block;
      margin-bottom: 4px;
      color: var(--text);
      font-size: 17px;
    }

    .loading-state {
      position: relative;
      z-index: 1;
      display: none;
      width: min(460px, calc(100% - 32px));
      text-align: center;
      border: 1px solid rgba(255, 255, 255, 0.82);
      border-radius: 24px;
      padding: 34px 26px;
      color: var(--subtle);
      background: rgba(255, 255, 255, 0.78);
      box-shadow: var(--shadow-soft);
      line-height: 1.75;
      backdrop-filter: blur(18px);
    }

    .loading-state.is-visible {
      display: block;
    }

    .loading-orbit {
      position: relative;
      width: 72px;
      height: 72px;
      margin: 0 auto 16px;
      border-radius: 50%;
      background: conic-gradient(from 0deg, var(--primary), var(--pink), var(--cyan), var(--primary));
      animation: spin 1s linear infinite;
    }

    .loading-orbit::before {
      content: "";
      position: absolute;
      inset: 8px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.95);
    }

    .loading-orbit::after {
      content: "";
      position: absolute;
      top: 6px;
      left: 50%;
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background: #fff;
      box-shadow: 0 0 18px rgba(109, 93, 252, 0.45);
      transform: translateX(-50%);
    }

    .loading-state strong {
      display: block;
      margin-bottom: 4px;
      color: var(--text);
      font-size: 17px;
    }

    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }

    .generated-image {
      position: relative;
      z-index: 1;
      display: none;
      width: min(100%, 900px);
      max-height: 74vh;
      object-fit: contain;
      border-radius: 20px;
      background: #fff;
      box-shadow: 0 26px 60px rgba(21, 24, 42, 0.24);
    }

    .meta {
      display: none;
      margin: 0 18px 18px;
      border: 1px solid rgba(91, 99, 130, 0.12);
      border-radius: 20px;
      padding: 14px 16px;
      color: var(--subtle);
      background: rgba(255, 255, 255, 0.72);
      line-height: 1.68;
      word-break: break-word;
    }

    .meta strong {
      color: #252b3f;
    }

    .error-box {
      display: none;
      margin: 0 18px 18px;
      border: 1px solid rgba(217, 45, 32, 0.24);
      border-radius: 20px;
      background: rgba(217, 45, 32, 0.08);
      color: var(--danger);
      padding: 14px 16px;
      white-space: pre-wrap;
      line-height: 1.58;
    }

    .toast {
      position: fixed;
      right: 20px;
      bottom: 20px;
      z-index: 10;
      display: none;
      max-width: min(420px, calc(100vw - 40px));
      border: 1px solid rgba(255, 255, 255, 0.7);
      border-radius: 18px;
      padding: 13px 15px;
      color: #fff;
      background: rgba(22, 24, 40, 0.86);
      box-shadow: 0 18px 42px rgba(22, 24, 40, 0.22);
      backdrop-filter: blur(16px);
      font-size: 14px;
      line-height: 1.5;
    }

    .toast.is-visible {
      display: block;
      animation: toastIn 0.18s ease both;
    }

    @keyframes toastIn {
      from {
        opacity: 0;
        transform: translateY(8px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @media (max-width: 940px) {
      .hero {
        grid-template-columns: 1fr;
      }

      .hero-card {
        display: none;
      }

      .layout {
        grid-template-columns: 1fr;
      }

      .form-panel {
        position: static;
      }

      .result-panel {
        min-height: 520px;
      }

      .preview {
        min-height: 420px;
      }
    }

    @media (max-width: 560px) {
      .shell {
        width: min(100% - 20px, 1240px);
        padding-top: 20px;
      }

      .settings,
      .mode-tabs,
      .actions {
        grid-template-columns: 1fr;
      }

      .button,
      .tool-button {
        width: 100%;
      }

      .result-head {
        align-items: stretch;
        flex-direction: column;
      }

      .result-actions {
        justify-content: stretch;
      }

      .history-toggle {
        top: auto;
        right: 12px;
        bottom: 16px;
      }

      .preview-wrap {
        padding: 12px;
      }

      .preview {
        min-height: 360px;
        border-radius: 20px;
      }
    }
