/* Shared navy palette, blue accents and rounded panels of the FileShare tools. */
.secret-main { padding-block: 36px 20px; }
.field-hint { color: var(--muted); font-size: 13px; line-height: 1.7; }
.security-badge { color: #8ce2cc; background: #18332f; border: 1px solid #30564f; padding: 8px 12px; border-radius: 20px; white-space: nowrap; font-size: 11px; }
button { border: 1px solid #354d6c; background: #1b2b42; color: #dce9fb; border-radius: 9px; padding: 9px 14px; min-height: 40px; font-size: 12px; }
button:hover { background: #2a4161; }
button:disabled { opacity: .5; cursor: default; }
input, textarea, select { font: inherit; color: #edf3fa; border: 1px solid #30435d; border-radius: 9px; background: #0e1929; padding: 11px 12px; width: 100%; min-width: 0; }
input, select { font-size: 13px; }
input::placeholder, textarea::placeholder { color: #8296b0; opacity: 1; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid #a7c7ff; outline-offset: 2px; }
.workspace-toolbar, .memo-heading, .memo-footer, .run-row, .history-summary, .dialog-heading, .dialog-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.workspace-toolbar { margin-bottom: 18px; }
.mode-switch { display: flex; gap: 4px; border: 1px solid #2a3b53; background: #0c1625; border-radius: 12px; padding: 4px; margin: 0; }
.mode-switch label { position: relative; cursor: pointer; }
.mode-switch input { position: absolute; opacity: 0; width: 1px; }
.mode-switch span { display: block; padding: 9px 28px; border-radius: 8px; color: #afc0d2; font-size: 13px; }
.mode-switch input:checked + span { background: #2b4c79; color: #fff; box-shadow: inset 0 1px #ffffff1a; }
.mode-switch input:focus-visible + span { outline: 2px solid #a7c7ff; }
.workspace-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.workspace-layout.settings-collapsed { grid-template-columns: minmax(0, 1fr); }
.editor-area { min-width: 0; display: grid; gap: 18px; }
.memo-card, .settings-panel { border: 1px solid #31445f; border-radius: 18px; background: linear-gradient(135deg, #18263b, #142034); box-shadow: 0 8px 24px #03091420; overflow: hidden; }
.memo-heading { padding: 17px 22px; border-bottom: 1px solid #2a3b53; font-size: 14px; font-weight: 600; }
.step { color: #91a8c7; font-size: 9px; letter-spacing: 1.5px; font-weight: 600; }
.memo-card textarea { display: block; padding: 22px; min-height: 175px; resize: vertical; border: 0; border-radius: 0; background: #101c2d80; font-size: 14px; line-height: 1.8; }
.memo-card textarea:focus-visible { outline-offset: -3px; }
.output-card { border-color: #37577b; }
.memo-footer { padding: 10px 20px; min-height: 52px; color: #91a8c7; font-size: 11px; }
.text-button { border: 0; background: transparent; color: #a7c7ff; padding: 4px 8px; min-height: 32px; }
.primary-button { background: #3473ce; border-color: #568ee0; color: #fff; font-weight: 600; padding: 12px 22px; }
.primary-button:hover { background: #4384df; }
.run-row { padding: 4px 0; }
#status { font-size: 12px; color: #afc0d2; overflow-wrap: anywhere; }
#status[data-error="true"] { color: #ffadad; }
.settings-panel { padding: 22px; }
h2 { font-size: 16px; font-weight: 600; }
.panel-heading .step { display: block; margin: 7px 0 12px; }
.settings-panel label, dialog > label { display: block; margin: 17px 0 7px; font-size: 12px; font-weight: 550; }
.workspace-input-row { display: flex; align-items: stretch; gap: 8px; }
.workspace-input-row input { flex: 1; width: 0; padding-inline: 9px; }
.workspace-input-row button { flex-shrink: 0; white-space: nowrap; padding-inline: 9px; font-size: 11px; }
.optional { color: #91a8c7; float: right; font-size: 10px; font-weight: 400; }
.conversation-group { border: 0; border-top: 1px solid #31445f; padding: 8px 0 0; margin: 26px 0 0; min-width: 0; }
.conversation-group summary { padding-block: 8px; cursor: pointer; font-size: 13px; font-weight: 600; }
.history-summary { padding: 18px 0; font-size: 12px; }
.history-summary strong { display: block; color: #a7c7ff; margin-top: 5px; font-size: 11px; font-weight: 400; }
.conversation-group .field-hint { font-size: 11px; }
.secret-footer { display: flex; justify-content: space-between; gap: 18px; color: #91a8c7; font-size: 11px; padding: 28px 0 0; }
dialog { color: #edf3fa; background: #142034; border: 1px solid #405b7f; border-radius: 20px; padding: 26px; width: min(650px, calc(100% - 32px)); max-height: 90dvh; overflow: auto; box-shadow: 0 24px 100px #0008; }
dialog::backdrop { background: #030914bf; backdrop-filter: blur(5px); }
.dialog-heading { margin-bottom: 14px; }
.dialog-heading h2 { font-size: 23px; margin-top: 5px; }
.history-table-scroll { max-height: 34dvh; overflow: auto; margin-top: 18px; }
.history-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.history-table th { text-align: left; font-size: 12px; color: #afc0d2; padding: 0 8px 8px; }
.history-table td { padding: 5px 0; border-top: 1px solid #30435d; vertical-align: top; }
.history-actions-column { width: 44px; }
.history-table .history-actions { padding-left: 8px; }
.history-table textarea { display: block; resize: vertical; font-size: 13px; line-height: 20px; min-height: 36px; padding: 7px 9px; border-color: transparent; border-radius: 6px; }
.history-table textarea:hover { border-color: #405b7f; }
.history-remove { display: grid; place-items: center; width: 36px; height: 36px; min-height: 36px; padding: 8px; background: transparent; border-color: transparent; }
.history-remove:hover { color: #ffadad; background: #462b38; }
.history-remove svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#emptyHistory { color: #91a8c7; font-size: 13px; padding: 18px 0; }
#historyStatus { min-height: 24px; font-size: 12px; color: #a7c7ff; }
.dialog-actions { flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 1000px) { .security-badge { display: none; } .page-width { width: calc(100% - 40px); } .workspace-layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; } }
@media (max-width: 720px) { .workspace-layout { grid-template-columns: 1fr; } .settings-panel { grid-row: 1; } .secret-main { padding-top: 24px; } .memo-heading { padding-inline: 16px; } .memo-footer { padding-inline: 12px; } .run-row { flex-wrap: wrap; } .run-row .primary-button { width: 100%; } .secret-footer { flex-direction: column; } .site-header { min-height: 84px; } }

/* Keep the access controls compact and leave room for both message memos. */
.password-input-row, .owner-signature-input-row { position: relative; }
.password-input-row input, .owner-signature-input-row input { padding-right: 44px; }
#togglePassword, #retrieveOwnerSignature { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 36px; height: 36px; min-height: 36px; padding: 8px; background: transparent; border-color: transparent; }
#togglePassword:hover, #retrieveOwnerSignature:hover { background: #2a4161; }
#togglePassword svg, #retrieveOwnerSignature svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#togglePassword .eye-slash { display: none; }
#togglePassword[aria-pressed="true"] .eye-slash { display: block; }
.run-feedback { min-width: 0; }
.run-feedback .security-badge { display: inline-block; }
.conversation-group { margin-top: 20px; padding-top: 8px; }
@media (min-width: 721px) {
    .site-header { min-height: 80px; }
    .secret-main { padding-block: 20px 16px; }
    .workspace-toolbar { margin-bottom: 14px; }
    .editor-area { gap: 14px; }
    .memo-heading { padding: 12px 18px; }
    .memo-card textarea { min-height: 80px; height: clamp(80px, calc((100dvh - 540px) / 2), 175px); padding: 16px 18px; }
    .memo-footer { min-height: 40px; padding: 4px 14px; }
    .secret-footer { padding-top: 16px; }
    .settings-panel { padding: 18px; }
}
@media (max-width: 720px) {
    .workspace-toolbar { flex-wrap: wrap; }
    #toggleSettings { margin-left: auto; }
    .site-header { gap: 12px; }
    .site-header .brand { gap: 8px; }
    .site-header .brand-name { font-size: 20px; }
}

.secret-brand { flex: 1; min-width: 0; gap: 12px; }
.secret-brand .brand-mark { flex: 0 0 48px; height: 48px; border-radius: 15px; }
.secret-brand-copy { min-width: 0; }
.secret-brand h1 { margin: 2px 0 0; font-size: clamp(21px, 3vw, 30px); font-weight: 750; line-height: 1.15; letter-spacing: -.035em; }
.brand-tagline { margin-top: 6px; color: #83aef2; font-size: 10px; line-height: 1.6; font-weight: 800; letter-spacing: .17em; }
.site-header > .nav-link { flex-shrink: 0; }
@media (max-width: 720px) {
    .site-header { flex-wrap: wrap; padding-block: 16px; }
    .site-header .secret-brand { flex: 1 1 300px; gap: 10px; }
    .secret-brand .brand-mark { flex-basis: 40px; height: 40px; border-radius: 12px; }
    .secret-brand h1 { font-size: clamp(20px, 4vw, 28px); }
    .brand-tagline { font-size: 9px; letter-spacing: .1em; }
    .site-header > .nav-link { margin-left: auto; }
}

/* Match the sharing tool's enclosing frame and compact navigation icons. */
.secret-shell { width: min(1208px, calc(100% - 40px)); margin: 24px auto; padding: 24px; border: 1px solid #314664; border-radius: 30px; background: linear-gradient(145deg, #192b41, #101c2d); box-shadow: inset 0 1px 0 #718bad40, 0 18px 50px #03091460; }
.secret-shell > .page-width { width: 100%; }
.secret-shell .site-header { min-height: 64px; border-bottom: 0; gap: 16px; }
.secret-tools { display: flex; flex-shrink: 0; gap: 8px; }
.utility-button { display: grid; place-items: center; width: 38px; height: 38px; min-height: 38px; padding: 8px; border: 1px solid #314664; border-radius: 12px; background: #17263b; color: #afc0d2; }
.utility-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.utility-button:hover { background: #243e60; border-color: #648bbd; color: #fff; }
.secret-footer { align-items: center; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid #314664; }
.secret-footer .secret-tools { margin-left: auto; }
#helpDialog .field-hint + .field-hint { margin-top: 14px; }
@media (min-width: 721px) {
    .secret-main { padding-block: 12px 0; }
    .memo-card textarea { height: clamp(80px, calc((100dvh - 610px) / 2), 175px); }
}
@media (max-width: 720px) {
    .secret-shell { width: calc(100% - 24px); margin-block: 12px; padding: 16px; border-radius: 22px; }
    .secret-shell .site-header { padding-top: 0; }
    .secret-tools { margin-left: auto; }
    .secret-footer { flex-direction: row; }
    .secret-main { padding-bottom: 0; }
}

@media (max-width: 720px) {
    .secret-shell .site-header { flex-wrap: nowrap; gap: 8px; min-height: 48px; padding-bottom: 8px; }
    .site-header .secret-brand { flex: 1 1 0; gap: 8px; }
    .secret-brand .brand-mark { flex-basis: 32px; width: 32px; height: 36px; border-radius: 10px; }
    .secret-brand .brand-mark .icon { width: 23px; height: 23px; }
    .secret-brand h1 { font-size: clamp(15px, 4.4vw, 22px); white-space: nowrap; }
    .brand-tagline { margin-top: 4px; font-size: clamp(6px, 1.75vw, 9px); letter-spacing: .03em; white-space: nowrap; }
    .site-header .secret-tools { gap: 6px; margin-left: 0; }
    .site-header .utility-button { width: 30px; height: 34px; min-height: 34px; padding: 6px; border-radius: 10px; }
    .site-header .utility-button svg { width: 17px; height: 17px; }
}

@media (max-width: 350px) {
    .secret-shell { width: calc(100% - 16px); padding: 10px; }
    .secret-shell .site-header { gap: 6px; }
}

@media (max-width: 720px) {
    .secret-footer { flex-wrap: nowrap; gap: 8px; }
    .secret-footer > span { white-space: nowrap; font-size: clamp(7px, 2vw, 10px); }
    .secret-footer .secret-tools { gap: 6px; }
    .secret-footer .utility-button { width: 30px; height: 34px; min-height: 34px; padding: 6px; border-radius: 10px; }
    .secret-footer .utility-button svg { width: 17px; height: 17px; }
    .run-feedback .security-badge { display: none; }
    .run-feedback:has(#status[hidden]) { display: none; }
}

/* With settings closed, divide the available phone height between both memos. */
@media (max-width: 720px) {
    .secret-shell:has(.settings-collapsed) { display: flex; flex-direction: column; height: calc(100dvh - 24px); min-height: 540px; }
    .secret-shell:has(.settings-collapsed) .site-header { flex-shrink: 0; }
    .secret-shell:has(.settings-collapsed) .secret-main { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-top: 12px; }
    .secret-shell:has(.settings-collapsed) #secretForm { flex: 1; min-height: 0; display: flex; flex-direction: column; }
    .secret-shell:has(.settings-collapsed) .workspace-toolbar { flex-shrink: 0; margin-bottom: 12px; }
    .secret-shell:has(.settings-collapsed) .workspace-layout { flex: 1; min-height: 0; }
    .secret-shell:has(.settings-collapsed) .editor-area { height: 100%; min-height: 0; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; }
    .secret-shell:has(.settings-collapsed) .memo-card { display: flex; flex-direction: column; min-height: 0; }
    .secret-shell:has(.settings-collapsed) .memo-heading { flex-shrink: 0; padding: 10px 12px; font-size: 13px; }
    .secret-shell:has(.settings-collapsed) .memo-card textarea { flex: 1; min-height: 0; height: 0; padding: 12px; resize: none; font-size: 16px; line-height: 1.5; }
    .secret-shell:has(.settings-collapsed) .memo-footer { flex-shrink: 0; min-height: 36px; padding: 2px 10px; font-size: 10px; gap: 6px; }
    .secret-shell:has(.settings-collapsed) .run-row { padding: 0; gap: 6px; }
    .secret-shell:has(.settings-collapsed) .secret-footer { flex-shrink: 0; margin-top: 12px; padding-top: 10px; }
}

@media (max-width: 720px) {
    .workspace-toolbar { flex-wrap: nowrap; gap: 8px; }
    .mode-switch span { padding-inline: 16px; font-size: 12px; }
}

.conversation-section { position: relative; margin-top: 20px; padding-top: 8px; border-top: 1px solid #31445f; }
.conversation-section .conversation-group { margin: 0; padding: 0; border: 0; }
.conversation-section summary { min-height: 32px; font-size: 12px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.settings-actions { display: flex; gap: 4px; margin-left: auto; }
.settings-actions .utility-button { width: 30px; height: 30px; min-height: 30px; padding: 6px; border-radius: 8px; }
.settings-actions svg { width: 16px; height: 16px; }

.preset-input-row { display: flex; align-items: stretch; gap: 6px; }
.preset-input-row input { flex: 1; width: 0; }
.preset-input-row .preset-select { flex: 0 0 36px; width: 36px; padding: 6px; text-align: center; cursor: pointer; appearance: none; background: #1b2b42; color: #a7c7ff; }
.preset-select option { text-align: left; color: #edf3fa; background: #142034; }

.append-history-toggle { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: #afc0d2; font-size: 11px; font-weight: 400; cursor: pointer; }
.append-history-toggle input { flex: 0 0 14px; width: 14px; height: 14px; margin: 0; padding: 0; accent-color: #568ee0; }
