html,
      body {
        height: 100%;
        margin: 0;
        overflow: hidden;
        background: #fff;
        color: #1a1a1a;
        font-family: "Google Sans", sans-serif;
        font-optical-sizing: auto;
        font-variation-settings: "GRAD" 0;
      }

      .layout {
        display: grid;
        grid-template-columns: 240px minmax(0, 2fr) minmax(0, 3fr);
        grid-template-areas: "saved text image";
        gap: 16px;
        height: 100%;
        padding: 16px;
        box-sizing: border-box;
        overflow: hidden;
      }

      .layout.is-saved-collapsed {
        grid-template-columns: 48px minmax(0, 2fr) minmax(0, 3fr);
      }

      .saved-sidebar {
        grid-area: saved;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        min-width: 0;
        min-height: 0;
        overflow: hidden;
      }

      .saved-sidebar-inner {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-width: 0;
        min-height: 0;
        overflow: hidden;
      }

      .layout.is-saved-collapsed #saved-list,
      .layout.is-saved-collapsed #saved-empty,
      .layout.is-saved-collapsed #saved-error,
      .layout.is-saved-collapsed #saved-refresh {
        display: none !important;
      }

      .saved-sidebar-toggle {
        appearance: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 32px;
        width: 32px;
        height: 32px;
        margin: 0;
        padding: 0;
        border: 1px solid #d8dde6;
        border-radius: 6px;
        background: #fff;
        color: #1e40af;
        cursor: pointer;
      }

      .saved-sidebar-toggle:hover {
        border-color: #1e40af;
      }

      .saved-sidebar-toggle svg {
        display: block;
      }

      .image-panel {
        grid-area: image;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        min-width: 0;
        min-height: 0;
        overflow: hidden;
      }

      .browser-chrome {
        display: flex;
        align-items: center;
        gap: 6px;
        flex: 0 0 auto;
        margin-bottom: 10px;
        min-width: 0;
      }

      .browser-nav {
        appearance: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        padding: 0;
        border: 1px solid #d8dde6;
        border-radius: 6px;
        background: #fff;
        color: #1e40af;
        cursor: pointer;
      }

      .browser-nav:hover:not(:disabled) {
        border-color: #1e40af;
      }

      .browser-url {
        flex: 1 1 auto;
        min-width: 0;
        height: 32px;
        box-sizing: border-box;
        border: 1px solid #d8dde6;
        border-radius: 6px;
        padding: 0 10px;
        background: #f6f7f9;
        color: #1a1a1a;
        font: inherit;
        font-size: 13px;
        cursor: default;
      }

      .take-control {
        appearance: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        height: 32px;
        box-sizing: border-box;
        padding: 0 10px;
        border: 1px solid #d8dde6;
        border-radius: 6px;
        background: #fff;
        color: #1e40af;
        font: inherit;
        font-size: 12px;
        font-weight: 500;
        white-space: nowrap;
        cursor: pointer;
      }

      .take-control:hover {
        border-color: #1e40af;
      }

      .sign-in-btn {
        appearance: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        padding: 0;
        border: none;
        border-radius: 50%;
        background: #1e40af;
        color: #fff;
        font: inherit;
        font-size: 12px;
        font-weight: 600;
        line-height: 1;
        cursor: pointer;
        flex: 0 0 auto;
        overflow: hidden;
        user-select: none;
        box-sizing: border-box;
      }

      .sign-in-btn:hover:not(:disabled) {
        filter: brightness(0.95);
      }

      .sign-in-btn svg {
        display: block;
      }

      .sign-in-menu {
        position: fixed;
        z-index: 8;
        min-width: 200px;
        max-width: min(280px, calc(100vw - 24px));
        padding: 10px 10px 8px;
        border: 1px solid #d8dde6;
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        box-sizing: border-box;
      }

      .sign-in-menu[hidden] {
        display: none;
      }

      .sign-in-menu-status {
        margin: 0 0 2px;
        color: #6b7280;
        font-size: 11px;
        font-weight: 500;
      }

      .sign-in-menu-email {
        margin: 0 0 8px;
        color: #111827;
        font-size: 13px;
        font-weight: 600;
        overflow-wrap: anywhere;
      }

      .sign-in-menu-out {
        appearance: none;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 32px;
        padding: 0 10px;
        border: 1px solid #d8dde6;
        border-radius: 6px;
        background: #fff;
        color: #1e40af;
        font: inherit;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
      }

      .sign-in-menu-out:hover:not(:disabled) {
        border-color: #1e40af;
      }

      .browser-chrome[hidden],
      .saved-run-chrome[hidden] {
        display: none !important;
      }

      .saved-run-chrome {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 0 0 auto;
        margin-bottom: 10px;
        min-width: 0;
        height: 32px;
      }

      .saved-run-record {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #e11d48;
        flex: 0 0 auto;
      }

      .saved-run-record[hidden] {
        display: none;
      }

      .saved-run-title {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: #111827;
        font-size: 14px;
        font-weight: 500;
      }

      .image-frame {
        flex: 1 1 auto;
        min-height: 0;
        display: grid;
        place-items: center;
        overflow: hidden;
        background: #f8f9fb;
        border: 1px solid #e6e9ef;
        border-radius: 12px;
      }

      .image-frame:has(#preview-stack:not([hidden])) {
        place-items: stretch;
        background: #fff;
      }

      .preview-stack {
        position: relative;
        width: 100%;
        height: 100%;
        min-height: 0;
      }

      .preview-stack[hidden] {
        display: none;
      }

      .preview-shot {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: top center;
        opacity: 0;
        transition: opacity 120ms ease;
      }

      .preview-shot.is-on {
        opacity: 1;
      }

      img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
      }

      .preview-empty {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 8px;
        max-width: 420px;
        padding: 40px 32px;
      }

      .preview-empty[hidden] {
        display: none;
      }

      .app-brand {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 0 0 auto;
        min-width: 0;
        margin-bottom: 10px;
      }

      .app-brand-mark {
        display: block;
        width: 28px;
        height: 28px;
        flex: 0 0 auto;
      }

      .app-brand-name {
        color: #1e40af;
        font-size: 15px;
        font-weight: 700;
        letter-spacing: -0.02em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .layout.is-saved-collapsed .saved-sidebar .app-brand {
        justify-content: center;
        margin-bottom: 8px;
      }

      .layout.is-saved-collapsed .saved-sidebar .app-brand-name {
        display: none;
      }

      .preview-empty-mark {
        display: grid;
        place-items: center;
        width: 64px;
        height: 64px;
        margin-bottom: 12px;
        border: 1px solid #eceff3;
        border-radius: 18px;
        background: #fcfcfd;
        box-shadow: 0 8px 20px rgba(16, 24, 40, 0.03);
        color: #b7c3d6;
      }

      .preview-empty-title {
        margin: 0;
        color: #b4bbc6;
        font-size: 18px;
        font-weight: 500;
        letter-spacing: -0.02em;
        line-height: 1.35;
      }

      .preview-empty-hint {
        margin: 0;
        color: #cdd2d9;
        font-size: 13px;
        font-weight: 400;
        line-height: 1.5;
      }

      p {
        margin: 0;
        color: #8b95a5;
        font-size: 14px;
      }

      .text-panel {
        grid-area: text;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        min-width: 0;
        min-height: 0;
        overflow: hidden;
        background: #fff;
      }

      .tabs {
        flex: 0 0 auto;
        border-bottom: 1px solid #e6e9ef;
      }

      .tab-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        align-items: end;
      }

      .tab {
        appearance: none;
        background: none;
        border: none;
        padding: 0 0 10px;
        margin: 0;
        color: #1e40af;
        font: inherit;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        border-bottom: 2px solid transparent;
        margin-bottom: -1px;
      }

      .tab[data-tab="create"] {
        justify-self: start;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding-right: 12px;
      }

      .tab[data-tab="history"] {
        justify-self: end;
      }

      .tab:hover {
        color: #1e40af;
      }

      .tab.active {
        color: #1e40af;
        border-bottom-color: #1e40af;
      }

      .create-toolbar {
        display: flex;
        flex: 0 0 auto;
        justify-content: space-between;
        align-items: flex-start;
        gap: 8px;
        margin-top: 8px;
        margin-bottom: 12px;
      }

      .create-toolbar-start {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        min-width: 0;
      }

      .create-toolbar-end {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        gap: 8px;
        margin-left: auto;
      }

      .history-save-btn {
        appearance: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 32px;
        padding: 0 10px;
        border: 1px solid #d8dde6;
        border-radius: 6px;
        background: #fff;
        color: #1e40af;
        font: inherit;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
      }

      .history-save-btn:hover:not(:disabled) {
        border-color: #1e40af;
      }

      .settings-btn {
        appearance: none;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        flex: 0 0 auto;
        border: 1px solid #d8dde6;
        border-radius: 6px;
        padding: 4px 10px 6px;
        background: #fff;
        color: #1e40af;
        font: inherit;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
      }

      .settings-btn {
        justify-content: center;
        width: 32px;
        height: 32px;
        padding: 0;
      }

      .settings-btn:hover:not(:disabled) {
        border-color: #1e40af;
      }

      .run-all-btn {
        appearance: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        height: 32px;
        padding: 0 10px;
        border: 1px solid #d8dde6;
        border-radius: 6px;
        background: #fff;
        color: #1e40af;
        font: inherit;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
      }

      .run-all-btn:hover:not(:disabled) {
        border-color: #1e40af;
      }

      .run-all-btn.is-stop {
        background: #fff;
        color: #1a1a1a;
        border-color: #c62828;
      }

      .run-all-btn.is-stop:hover:not(:disabled) {
        background: #fff;
        border-color: #b71c1c;
      }

      .run-all-btn.is-stop svg {
        color: #c62828;
      }

      .run-all-btn.is-stop:hover:not(:disabled) svg {
        color: #b71c1c;
      }

      .run-all-btn svg {
        display: block;
        flex: 0 0 auto;
      }

      .settings-btn svg {
        display: block;
        flex: 0 0 auto;
        overflow: visible;
      }

      .tab-panel {
        display: none;
      }

      .tab-panel.active {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
      }

      #panel-history.tab-panel.active {
        overflow: hidden;
      }

      .cells {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        gap: 12px;
        overflow-y: auto;
      }

      .cell-row {
        min-width: 0;
      }

      .cell-row.is-skipped {
        opacity: 0.55;
      }

      .cell-row.is-error .cell-result {
        border-color: #f3c7c7;
      }

      .cell-intent.is-working .cell-intent-text {
        color: #6b7280;
        animation: working-pulse 1.4s ease-in-out infinite;
      }

      @keyframes working-pulse {
        0%,
        100% {
          opacity: 0.4;
        }
        50% {
          opacity: 1;
        }
      }

      .add-cell {
        appearance: none;
        border: 1px solid #d8dde6;
        border-radius: 6px;
        padding: 4px 10px 6px;
        background: #fff;
        color: #1e40af;
        font: inherit;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
      }

      .add-cell:hover:not(:disabled) {
        border-color: #1e40af;
      }

      .cell-footer-left {
        display: flex;
        align-items: center;
        gap: 8px;
      }

      .delete-cell {
        appearance: none;
        width: 28px;
        height: 28px;
        padding: 0;
        border: 1px solid #d8dde6;
        border-radius: 6px;
        background: #fff;
        color: #1e40af;
        display: grid;
        place-items: center;
        cursor: pointer;
      }

      .delete-cell:hover:not(:disabled) {
        border-color: #1e40af;
      }

      .delete-cell svg {
        display: block;
      }

      .cell {
        min-width: 0;
      }

      .cell-input {
        position: relative;
      }

      .cell-send {
        appearance: none;
        position: relative;
        flex: 0 0 24px;
        margin-left: auto;
        width: 24px;
        height: 24px;
        padding: 0;
        border: none;
        border-radius: 50%;
        background: #1e40af;
        color: #fff;
        display: grid;
        place-items: center;
        cursor: pointer;
      }

      .cell-send:hover:not(:disabled) {
        background: #1e3a8a;
      }

      .cell-send.is-stop {
        background: #c62828;
        color: #fff;
      }

      .cell-send.is-stop:hover:not(:disabled) {
        background: #b71c1c;
        color: #fff;
      }

      .cell-send svg {
        display: block;
      }

      .cell-send.is-stop svg {
        width: 8px;
        height: 8px;
      }

      .cell-cost {
        margin-left: auto;
        color: #8b95a5;
        font-size: 12px;
        line-height: 1.3;
        font-variant-numeric: tabular-nums;
      }

      .cell-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-top: 6px;
      }

      .cell-result {
        margin-top: 10px;
        border: 1px solid #e6e9ef;
        border-radius: 8px;
        padding: 12px 14px;
        background: #f3f3f3;
      }

      .cell-result[hidden] {
        display: none;
      }

      .result-reset {
        margin: 0 0 10px;
        color: #8b95a5;
        font-size: 12px;
      }

      .result-error {
        margin: 0;
        color: #c62828;
        font-size: 13px;
        white-space: pre-wrap;
      }

      .result-summary {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        margin: 0;
        color: #1a1a1a;
        font-size: 14px;
        line-height: 1.45;
      }

      .result-arrow {
        flex: 0 0 auto;
        color: #2f5bff;
        font-weight: 700;
      }

      .result-checks {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 10px;
      }

      .result-check {
        display: grid;
        grid-template-columns: 18px 1fr;
        gap: 8px;
        align-items: start;
      }

      .result-mark {
        width: 18px;
        height: 18px;
        margin-top: 1px;
        border-radius: 50%;
        display: grid;
        place-items: center;
        font-size: 11px;
        font-weight: 700;
        line-height: 1;
        color: #fff;
      }

      .result-mark.pass {
        background: #1a7f4c;
      }

      .result-mark.fail {
        background: #c62828;
      }

      .result-check-text {
        margin: 0;
        font-size: 13px;
        line-height: 1.4;
        color: #1a1a1a;
      }

      .result-observed {
        margin: 4px 0 0;
        color: #8b95a5;
        font-size: 12px;
        line-height: 1.4;
      }

      .model-select {
        appearance: none;
        flex: 0 1 auto;
        max-width: 42%;
        border: 1px solid #d8dde6;
        border-radius: 6px;
        padding: 4px 28px 4px 8px;
        background: #fff
          url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238b95a5' d='M1 1l5 5 5-5'/%3E%3C/svg%3E")
          no-repeat right 8px center;
        color: #1a1a1a;
        font: inherit;
        font-size: 12px;
        line-height: 1.3;
        cursor: pointer;
      }

      .cell-input-bar {
        position: absolute;
        left: 10px;
        right: 10px;
        bottom: 10px;
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
        overflow: visible;
      }

      .cell-intent {
        margin-top: 6px;
        display: flex;
        align-items: center;
        gap: 8px;
        text-align: left;
        color: #000;
        font-size: 12px;
        line-height: 1.3;
      }

      .cell-intent-progress {
        flex: 0 0 auto;
        width: 12px;
        height: 12px;
        border: 1.5px solid #d8dde6;
        border-top-color: #1e40af;
        border-radius: 50%;
        animation: cell-intent-spin 0.7s linear infinite;
      }

      .cell-intent-text {
        min-width: 0;
      }

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

      .cell-intent[hidden] {
        display: none;
      }

      .model-select:focus {
        outline: none;
        border-color: #2f5bff;
      }

      textarea:disabled,
      .cell-send:disabled,
      .send:disabled,
      .close-browser:disabled,
      .browser-nav:disabled,
      .settings-btn:disabled,
      .history-save-btn:disabled,
      .run-all-btn:disabled,
      .add-cell:disabled,
      .delete-cell:disabled,
      .saved-refresh:disabled,
      .saved-row-btn:disabled,
      .model-select:disabled {
        opacity: 0.6;
        cursor: not-allowed;
      }

      textarea {
        width: 100%;
        min-height: 72px;
        height: auto;
        box-sizing: border-box;
        overflow: hidden;
        resize: none;
        border: 1px solid #d8dde6;
        border-radius: 6px;
        padding: 10px 12px 40px;
        background: #fff;
        color: #1a1a1a;
        font-family: inherit;
        font-size: 14px;
        line-height: 1.45;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        word-break: break-word;
        outline: none;
      }

      .cell-input:has(.cell-send) textarea {
        padding: 10px 42px 40px 12px;
      }

      textarea::placeholder {
        color: #a0a8b4;
      }

      textarea:focus {
        outline: none;
        border-color: #d8dde6;
      }

      .saved-toolbar {
        display: flex;
        flex: 0 0 auto;
        justify-content: flex-end;
        align-items: center;
        gap: 8px;
        margin-bottom: 6px;
      }

      .saved-sidebar .saved-toolbar {
        justify-content: flex-start;
      }

      .layout.is-saved-collapsed .saved-sidebar .saved-toolbar {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 8px;
      }

      .saved-new {
        appearance: none;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin: 0;
        border: 1px solid #d8dde6;
        border-radius: 6px;
        padding: 4px 8px;
        background: #fff;
        color: #1e40af;
        font: inherit;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
      }

      .saved-new svg {
        display: block;
        flex: 0 0 auto;
      }

      .saved-new:hover:not(:disabled) {
        border-color: #1e40af;
      }

      .saved-new:disabled {
        opacity: 0.6;
        cursor: not-allowed;
      }

      .layout.is-saved-collapsed .saved-new {
        justify-content: center;
        width: 32px;
        height: 32px;
        padding: 0;
      }

      .layout.is-saved-collapsed .saved-new-label {
        display: none;
      }

      #saved-error {
        flex: 0 0 auto;
        margin: 0 0 6px;
        color: #b42318;
        font-size: 12px;
      }

      #saved-error[hidden] {
        display: none !important;
      }

      .saved-refresh {
        appearance: none;
        border: none;
        background: none;
        padding: 4px 0;
        color: #8b95a5;
        font: inherit;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
      }

      .saved-sidebar .saved-refresh {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        margin-left: auto;
        padding: 0;
      }

      .saved-sidebar .saved-refresh svg {
        display: block;
      }

      .saved-refresh:hover:not(:disabled) {
        color: #1e40af;
      }

      #saved-list-view,
      #history-list-view,
      #history-detail-view {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
      }

      #history-list-view[hidden],
      #history-detail-view[hidden] {
        display: none !important;
      }

      .saved-list {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        gap: 6px;
        margin: 0;
        padding: 0;
        list-style: none;
        overflow-y: auto;
      }

      .saved-list:empty {
        flex: 0 0 auto;
        overflow: visible;
      }

      #saved-empty {
        font-size: 12px;
      }

      .saved-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 8px 10px;
        border: 1px solid #e6e9ef;
        border-radius: 6px;
        font-size: 14px;
        cursor: pointer;
      }

      .saved-sidebar .saved-row {
        gap: 6px;
        padding: 6px 8px;
        font-size: 12px;
      }

      .saved-row.is-open {
        border-color: #1e40af;
        background: #f5f8ff;
      }

      .saved-row-main {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-width: 0;
        gap: 2px;
      }

      .saved-row-name {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .saved-row-rename {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        border: 1px solid #1e40af;
        border-radius: 4px;
        padding: 2px 6px;
        background: #fff;
        color: #1a1a1a;
        font: inherit;
        font-size: 12px;
        line-height: 1.3;
      }

      .saved-row-rename:focus {
        outline: none;
      }

      .saved-row-actions {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        gap: 4px;
      }

      .saved-row-btn {
        appearance: none;
        width: 28px;
        height: 28px;
        padding: 0;
        border: 1px solid #d8dde6;
        border-radius: 50%;
        background: #fff;
        color: #1e40af;
        display: grid;
        place-items: center;
        cursor: pointer;
      }

      .saved-sidebar .saved-row-btn {
        width: 24px;
        height: 24px;
      }

      .saved-row-btn:hover:not(:disabled) {
        border-color: #1e40af;
      }

      .saved-row-btn.delete {
        color: #c62828;
      }

      .saved-row-btn svg {
        display: block;
      }

      .saved-detail-toolbar {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        gap: 8px;
        margin-bottom: 8px;
      }

      .saved-detail-back {
        appearance: none;
        width: 28px;
        height: 28px;
        padding: 0;
        border: 1px solid #d8dde6;
        border-radius: 50%;
        background: #fff;
        color: #1e40af;
        display: grid;
        place-items: center;
        cursor: pointer;
        flex: 0 0 auto;
      }

      .saved-detail-back:hover {
        border-color: #1e40af;
        color: #1e3a8a;
      }

      .saved-detail-back svg {
        display: block;
      }

      .saved-detail-name {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: #111827;
        font-size: 14px;
        font-weight: 500;
      }

      #history-detail-status {
        flex: 0 0 auto;
      }

      .history-row-date {
        flex: 0 0 auto;
        color: #8b95a5;
        font-size: 12px;
        font-variant-numeric: tabular-nums;
      }

      .history-status {
        flex: 0 0 auto;
        border-radius: 999px;
        padding: 2px 8px;
        font-size: 11px;
        font-weight: 600;
        line-height: 1.4;
        color: #4b5563;
        background: #f3f4f6;
      }

      .history-status.is-done {
        color: #166534;
        background: #dcfce7;
      }

      .history-status.is-error {
        color: #991b1b;
        background: #fee2e2;
      }

      .history-status.is-stopped {
        color: #4b5563;
        background: #f3f4f6;
      }

      .history-status.is-running {
        color: #1e40af;
        background: #dbeafe;
      }

      .history-items {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        gap: 12px;
        overflow-y: auto;
      }

      .history-card {
        min-width: 0;
        padding: 10px 12px;
        border: 1px solid #e6e9ef;
        border-radius: 8px;
      }

      .history-prompt {
        margin: 0;
        color: #1a1a1a;
        font-size: 14px;
        line-height: 1.45;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        word-break: break-word;
      }

      .history-model {
        margin: 6px 0 0;
        color: #8b95a5;
        font-size: 12px;
      }

      .history-card .cell-result {
        margin-top: 10px;
      }

      .history-shots {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        margin-top: 10px;
        padding-bottom: 2px;
      }

      .history-shots[hidden] {
        display: none;
      }

      .history-shot {
        appearance: none;
        flex: 0 0 auto;
        padding: 0;
        border: 1px solid #e6e9ef;
        border-radius: 6px;
        background: #fff;
        cursor: pointer;
      }

      .history-shot:hover {
        border-color: #1e40af;
      }

      .history-shot img {
        display: block;
        height: 72px;
        width: auto;
        max-width: 160px;
        object-fit: cover;
        border-radius: 5px;
      }

      .app-toast {
        margin: 0;
        max-width: min(100%, 280px);
        padding: 6px 10px;
        border: 1px solid #bfdbfe;
        border-radius: 6px;
        background: #eff6ff;
        color: #1e40af;
        font-size: 12px;
        font-weight: 600;
        line-height: 1.3;
        text-align: left;
      }

      .app-toast[hidden] {
        display: none !important;
      }

      .history-lightbox {
        position: fixed;
        inset: 0;
        z-index: 20;
        display: grid;
        place-items: center;
        padding: 24px;
        background: rgba(0, 0, 0, 0.72);
      }

      .history-lightbox[hidden] {
        display: none;
      }

      .history-lightbox img {
        max-width: min(96vw, 1200px);
        max-height: 90vh;
        object-fit: contain;
        border-radius: 8px;
      }

      .history-lightbox-close {
        appearance: none;
        position: absolute;
        top: 16px;
        right: 16px;
        border: none;
        border-radius: 6px;
        padding: 6px 12px;
        background: #fff;
        color: #1e40af;
        font: inherit;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
      }

      body.auth-simple-body {
        overflow: auto;
        background: #fff;
      }

      .auth-simple-page {
        display: grid;
        min-height: 100vh;
        box-sizing: border-box;
        place-items: center;
        padding: 24px;
        text-align: center;
      }

      .auth-simple-text {
        margin: 0;
        max-width: 420px;
        color: #4b5563;
        font-size: 15px;
        font-weight: 500;
        line-height: 1.5;
      }

      .auth-simple-error {
        margin: 10px 0 0;
        max-width: 420px;
        color: #b42318;
        font-size: 13px;
        line-height: 1.4;
      }

      .auth-simple-error:empty {
        display: none;
      }

      .auth-result-page {
        display: grid;
        min-height: 100%;
        box-sizing: border-box;
        place-items: center;
        padding: 24px;
        background:
          radial-gradient(circle at 50% 35%, rgba(219, 234, 254, 0.55), transparent 34%),
          #f8fafc;
      }

      .auth-result-card {
        width: min(420px, 100%);
        box-sizing: border-box;
        padding: 32px 36px 34px;
        border: 1px solid #e5e9f0;
        border-radius: 18px;
        background: #fff;
        box-shadow:
          0 24px 64px rgba(15, 23, 42, 0.1),
          0 3px 12px rgba(15, 23, 42, 0.04);
        text-align: center;
      }

      .auth-result-brand {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 28px;
        color: #1e40af;
        font-size: 15px;
        font-weight: 700;
        letter-spacing: -0.02em;
      }

      .auth-result-brand-mark {
        display: grid;
        width: 34px;
        height: 34px;
        overflow: hidden;
        place-items: center;
        border: 1px solid #dbe5ff;
        border-radius: 10px;
        background: #f3f6ff;
      }

      .auth-result-brand-mark img {
        display: block;
        width: 30px;
        height: 30px;
      }

      .auth-result-state-mark {
        display: grid;
        width: 52px;
        height: 52px;
        margin: 0 auto 18px;
        place-items: center;
        border-radius: 50%;
        background: #eff6ff;
        color: #1e40af;
      }

      .auth-result-spinner {
        width: 20px;
        height: 20px;
        box-sizing: border-box;
        border: 2px solid #bfdbfe;
        border-top-color: #1e40af;
        border-radius: 50%;
        animation: auth-result-spin 0.8s linear infinite;
      }

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

      .auth-result-success-mark,
      .auth-result-error-mark {
        display: none;
      }

      .auth-result-card[data-state="success"] .auth-result-state-mark {
        background: #ecfdf3;
        color: #16804b;
      }

      .auth-result-card[data-state="success"] .auth-result-spinner {
        display: none;
      }

      .auth-result-card[data-state="success"] .auth-result-success-mark {
        display: block;
      }

      .auth-result-card[data-state="error"] .auth-result-state-mark {
        background: #fef2f2;
        color: #c62828;
      }

      .auth-result-card[data-state="error"] .auth-result-spinner {
        display: none;
      }

      .auth-result-card[data-state="error"] .auth-result-error-mark {
        display: block;
      }

      .auth-result-card h1 {
        margin: 0;
        color: #172033;
        font-size: 24px;
        font-weight: 700;
        letter-spacing: -0.035em;
        line-height: 1.25;
      }

      .auth-result-message {
        margin: 10px auto 0;
        color: #596579;
        font-size: 14px;
        line-height: 1.5;
      }

      .auth-result-error {
        margin: 12px 0 0;
        padding: 8px 10px;
        border-radius: 7px;
        background: #fef2f2;
        color: #b42318;
        font-size: 12px;
        line-height: 1.4;
      }

      .auth-result-error:empty {
        display: none;
      }

      .auth-result-hint {
        margin: 14px auto 0;
        color: #8b95a5;
        font-size: 13px;
        line-height: 1.5;
      }

      .modal {
        position: fixed;
        inset: 0;
        display: grid;
        place-items: center;
        background: rgba(0, 0, 0, 0.35);
        z-index: 10;
      }

      .modal[hidden] {
        display: none;
      }

      .modal-card {
        width: min(420px, calc(100% - 32px));
        padding: 16px;
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
      }

      .modal-card h2 {
        margin: 0 0 12px;
        color: #1e40af;
        font-size: 16px;
        font-weight: 600;
      }

      .modal-card input {
        width: 100%;
        box-sizing: border-box;
        border: 1px solid #d8dde6;
        border-radius: 6px;
        padding: 8px 10px;
        font: inherit;
        font-size: 14px;
      }

      .modal-card input:focus {
        outline: none;
        border-color: #2f5bff;
      }

      #apikey-modal .modal-card {
        padding: 16px;
      }

      .apikey-modal-header {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 12px;
      }

      #apikey-modal .apikey-modal-header h2 {
        margin: 0;
      }

      #apikey-modal .modal-status {
        margin: 0;
        font-size: 12px;
      }

      .apikey-hint {
        display: flex;
        align-items: flex-start;
        gap: 6px;
        margin: 8px 0 0;
        color: #8b93a1;
        font-size: 12px;
        line-height: 1.45;
      }

      .apikey-hint svg {
        flex: none;
        margin-top: 1px;
        color: #9aa3b2;
      }

      .apikey-hint a {
        color: #2f5bff;
        text-decoration: none;
      }

      .apikey-hint a:hover {
        text-decoration: underline;
      }

      .apikey-token-label {
        display: block;
        margin: 12px 0 6px;
        color: #1e40af;
        font-size: 13px;
        font-weight: 600;
      }

      #apikey-modal .modal-error {
        min-height: 16px;
        margin-top: 6px;
      }

      .modal-hint {
        margin: 0 0 8px;
        color: #4a4a4a;
        font-size: 13px;
        line-height: 1.4;
      }

      .modal-status {
        margin: 0 0 8px;
        color: #6b7280;
        font-size: 13px;
      }

      .modal-error {
        min-height: 18px;
        margin: 8px 0 0;
        color: #c03535;
        font-size: 13px;
      }

      .modal-message {
        margin: 0;
        color: #1a1a1a;
        font-size: 14px;
        line-height: 1.4;
      }

      .safety-modal-action {
        margin: 0 0 6px;
        color: #1a1a1a;
        font-size: 14px;
        font-weight: 600;
        text-transform: capitalize;
      }

      .safety-modal-explanation {
        margin: 0;
        color: #4a4a4a;
        font-size: 13px;
        line-height: 1.4;
      }

      .modal-actions {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        margin-top: 14px;
      }

      .google-sign-in-actions {
        justify-content: flex-end;
      }

      #sign-in-modal {
        background: rgba(15, 23, 42, 0.28);
        backdrop-filter: blur(6px);
      }

      #sign-in-modal .modal-card {
        position: relative;
        width: min(400px, calc(100% - 32px));
        padding: 0;
        overflow: hidden;
        border: 1px solid rgba(216, 221, 230, 0.8);
        border-radius: 18px;
        background:
          radial-gradient(circle at 100% 0, rgba(219, 234, 254, 0.7), transparent 34%),
          #fff;
        box-shadow:
          0 24px 64px rgba(15, 23, 42, 0.18),
          0 4px 14px rgba(15, 23, 42, 0.06);
      }

      .sign-in-brand-mark-wrap {
        display: grid;
        place-items: center;
        flex: 0 0 auto;
        width: 36px;
        height: 36px;
        overflow: hidden;
        border: 1px solid #dbe5ff;
        border-radius: 10px;
        background: #f3f6ff;
      }

      .sign-in-brand-mark {
        display: block;
        width: 32px;
        height: 32px;
      }

      .sign-in-content {
        padding: 28px 24px;
        text-align: left;
      }

      .sign-in-welcome {
        display: grid;
        grid-template-columns: 36px minmax(0, 1fr);
        align-items: start;
        gap: 12px;
      }

      .sign-in-welcome .sign-in-brand-mark-wrap {
        margin-top: -4px;
      }

      .sign-in-welcome-copy {
        min-width: 0;
      }

      #sign-in-modal .sign-in-title {
        margin: 0;
        color: #1e40af;
        font-size: 24px;
        font-weight: 700;
        letter-spacing: -0.035em;
        line-height: 1.2;
      }

      .sign-in-subtitle {
        margin: 6px 0 0;
        max-width: 320px;
        color: #6b7280;
        font-size: 14px;
        font-weight: 400;
        line-height: 1.5;
        white-space: nowrap;
      }

      #sign-in-modal .modal-error {
        min-height: 0;
        margin: 10px 0 0;
        text-align: left;
      }

      #sign-in-modal .modal-error:empty {
        display: none;
      }

      .sign-in-actions {
        justify-content: flex-end;
        margin-top: 0;
        padding: 17px 24px 20px;
        border-top: 1px solid #edf0f4;
        background: rgba(248, 250, 252, 0.78);
      }

      .gsi-material-button {
        -moz-user-select: none;
        -webkit-user-select: none;
        user-select: none;
        appearance: none;
        background-color: #fff;
        background-image: none;
        border: 1px solid #747775;
        border-radius: 4px;
        box-sizing: border-box;
        color: #1f1f1f;
        cursor: pointer;
        flex: 0 0 auto;
        font-family: "Google Sans", sans-serif;
        font-size: 14px;
        font-weight: 500;
        height: 40px;
        letter-spacing: 0.25px;
        line-height: 20px;
        outline: none;
        overflow: hidden;
        padding: 0 12px;
        position: relative;
        text-align: center;
        transition: background-color 0.218s, border-color 0.218s, box-shadow 0.218s;
        vertical-align: middle;
        white-space: nowrap;
        width: auto;
        max-width: 400px;
        min-width: min-content;
      }

      .gsi-material-button .gsi-material-button-icon {
        height: 20px;
        margin-right: 12px;
        min-width: 20px;
        width: 20px;
      }

      .gsi-material-button .gsi-material-button-icon svg {
        display: block;
      }

      .gsi-material-button .gsi-material-button-content-wrapper {
        align-items: center;
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        height: 100%;
        justify-content: space-between;
        position: relative;
        width: 100%;
      }

      .gsi-material-button .gsi-material-button-contents {
        flex-grow: 1;
        font-family: "Google Sans", sans-serif;
        font-size: 14px;
        font-weight: 500;
        line-height: 20px;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .gsi-material-button .gsi-material-button-contents-hidden {
        display: none;
      }

      .gsi-material-button .gsi-material-button-state {
        transition: opacity 0.218s;
        bottom: 0;
        left: 0;
        opacity: 0;
        position: absolute;
        right: 0;
        top: 0;
      }

      .gsi-material-button:disabled {
        cursor: default;
        background-color: #ffffff61;
        border-color: #1f1f1f1f;
      }

      .gsi-material-button:disabled .gsi-material-button-contents,
      .gsi-material-button:disabled .gsi-material-button-icon {
        opacity: 0.38;
      }

      .gsi-material-button:not(:disabled):hover {
        box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
      }

      .gsi-material-button:not(:disabled):hover .gsi-material-button-state {
        background-color: #303030;
        opacity: 0.08;
      }

      .gsi-material-button:not(:disabled):active .gsi-material-button-state,
      .gsi-material-button:not(:disabled):focus .gsi-material-button-state {
        background-color: #303030;
        opacity: 0.12;
      }

      .close-browser {
        appearance: none;
        border: 1px solid #d8dde6;
        border-radius: 6px;
        padding: 8px 16px;
        background: #fff;
        color: #1e40af;
        font: inherit;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
      }

      .close-browser:hover:not(:disabled) {
        border-color: #1e40af;
        color: #1e40af;
      }

      .send {
        appearance: none;
        border: none;
        border-radius: 6px;
        padding: 8px 16px;
        background: #1e40af;
        color: #fff;
        font: inherit;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
      }

      .send:hover:not(:disabled) {
        background: #1e3a8a;
      }

      .send:focus,
      .send:focus-visible {
        outline: none;
      }
