:root {
  --mono: "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --terminal-page: #f5f2ed;
  --terminal-surface: #fffdf9;
  --terminal-header: #e9e4dc;
  --terminal-text: #1c211e;
  --terminal-muted: #68706a;
  --terminal-border: #cfc8be;
  --terminal-input: #f3eee7;
  --terminal-success: #27844a;
  --accent: #c63333;
  --accent-hover: #982727;
  --focus: rgba(198, 51, 51, .22);
}

:root[data-theme="terminal"] {
  color-scheme: dark;
  --terminal-page: #171313;
  --terminal-surface: #201b1b;
  --terminal-header: #2a2220;
  --terminal-text: #f3e9df;
  --terminal-muted: #c6b4a5;
  --terminal-border: #51423d;
  --terminal-input: #191515;
  --terminal-success: #f2c078;
  --accent: #ff8278;
  --accent-hover: #ffa098;
  --focus: rgba(255, 130, 120, .28);
}

:root[data-theme="powershell"] {
  color-scheme: dark;
  --terminal-page: #001b3d;
  --terminal-surface: #062c60;
  --terminal-header: #0b438b;
  --terminal-text: #f5f9ff;
  --terminal-muted: #c5ddf5;
  --terminal-border: #4d8ed0;
  --terminal-input: #031f49;
  --terminal-success: #87e5dc;
  --accent: #ff9a8d;
  --accent-hover: #ffb6ac;
  --focus: rgba(255, 154, 141, .3);
}

body { background: var(--terminal-page); color: var(--terminal-text); }
.site-header { height: 64px; border-bottom-color: var(--terminal-border); background: var(--terminal-surface); }
.brand { color: var(--terminal-text); font-family: var(--mono); font-size: 18px; letter-spacing: -.8px; }
.brand-mark { width: 24px; height: 24px; color: var(--accent); }
.brand-mark svg { display: none; }
.brand-mark::before { content: ""; display: block; width: 100%; height: 100%; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Cpath d='M4 7h10M4 14h6M4 21h10M15 14h9m-4-4 4 4-4 4' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Cpath d='M4 7h10M4 14h6M4 21h10M15 14h9m-4-4 4 4-4 4' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.theme-control { display: inline-flex; align-items: center; gap: 8px; color: var(--terminal-muted); font: 12px/1 var(--mono); }
.theme-control select { border: 1px solid var(--terminal-border); border-radius: 4px; background: var(--terminal-input); color: var(--terminal-text); padding: 7px 28px 7px 9px; font: inherit; }
.landing { display: block; width: min(100%, 920px); min-height: auto; margin: 0 auto; padding: clamp(48px, 10vh, 108px) 20px 72px; }
.hero, .manage-card, .manual-card, .contact-card { width: 100%; text-align: left; }
.terminal-window { overflow: hidden; border: 1px solid var(--terminal-border); border-radius: 9px; background: var(--terminal-surface); box-shadow: 0 20px 55px rgba(0, 0, 0, .12); }
.terminal-bar { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 14px; border-bottom: 1px solid var(--terminal-border); background: var(--terminal-header); color: var(--terminal-muted); font: 12px/1 var(--mono); }
.terminal-dots { display: flex; gap: 6px; }
.terminal-dots i { width: 10px; height: 10px; border-radius: 50%; background: #d06060; }
.terminal-dots i:nth-child(2) { background: #d8ae58; }
.terminal-dots i:nth-child(3) { background: #55a670; }
.terminal-body { padding: clamp(24px, 4vw, 46px); }
.eyebrow { color: var(--accent); font-family: var(--mono); letter-spacing: .08em; }
h1 { color: var(--terminal-text); font-family: var(--mono); font-size: clamp(31px, 5vw, 50px); letter-spacing: -2px; }
.subtitle { color: var(--terminal-muted); font-family: var(--mono); font-size: 15px; }
.shorten-form { align-items: center; gap: 0; border: 1px solid var(--terminal-border); border-radius: 6px; background: var(--terminal-input); }
.command-prompt, .terminal-command { color: var(--accent); font: 700 14px/1.5 var(--mono); white-space: nowrap; }
.command-prompt { padding-left: 14px; }
.terminal-command { margin: 0 0 22px; }
.shorten-form input { height: 58px; padding: 0 14px; border: 0; background: transparent; color: var(--terminal-text); font-family: var(--mono); font-size: 14px; }
.shorten-form input:focus { box-shadow: none; }
.shorten-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.shorten-form button { height: 40px; margin-right: 8px; padding: 0 16px; border-radius: 4px; background: var(--accent); font-family: var(--mono); font-size: 13px; }
.form-hint { margin: 9px 0 0; color: var(--terminal-muted); font: 12px/1.5 var(--mono); }
.form-error { color: var(--accent); font-family: var(--mono); }
.terminal-result { margin-top: 18px; border: 1px solid var(--terminal-border); background: var(--terminal-input); font-family: var(--mono); }
.terminal-result-row { padding: 18px; border-bottom: 1px solid var(--terminal-border); }
.terminal-result-row:last-child { border-bottom: 0; }
.terminal-success { margin: 0 0 10px; color: var(--terminal-success); font: 700 13px/1.5 var(--mono); }
.terminal-value { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--terminal-muted); font-family: var(--mono); }
.terminal-value > a, .terminal-value > input { min-width: 0; flex: 1; color: var(--terminal-text); font-family: var(--mono); font-size: 14px; }
.terminal-value > a { overflow-wrap: anywhere; word-break: break-word; }
.result-url { color: var(--terminal-text); font-size: 14px; font-family: var(--mono); font-weight: 600; }
.manage-note { max-width: none; margin: 0 0 10px; color: var(--terminal-muted); font-family: var(--mono); font-size: 12px; }
.manage-url { width: auto; height: auto; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.copy-button { min-height: 32px; border-color: var(--terminal-border); border-radius: 4px; background: var(--terminal-surface); color: var(--terminal-text); font-family: var(--mono); font-size: 12px; }
.copy-button:hover { background: var(--terminal-header); }
.manage-card { padding: 0; border: 0; border-radius: 9px; background: transparent; }
.manage-card h1, .manage-card .eyebrow, .manage-card .subtitle { text-align: left; }
.status-list.terminal-status { margin: 25px 0 30px; padding: 0; border: 0; background: transparent; font-family: var(--mono); }
.status-list.terminal-status .terminal-status-row { display: grid; grid-template-columns: 156px minmax(0, 1fr); margin: 0; padding: 3px 0; border: 0; }
.terminal-status-key { padding: 5px 0; color: var(--terminal-muted); font: 600 13px/1.5 var(--mono); }
.terminal-status-key::after { content: ":"; }
.terminal-status-value { min-width: 0; margin: 0; padding: 5px 0; color: var(--terminal-text); font: 600 14px/1.5 var(--mono); }
.terminal-status-value.break-all { overflow-wrap: anywhere; }
.terminal-status-value a { color: var(--terminal-success); text-decoration-color: currentColor; text-underline-offset: 3px; }
.terminal-status-value.terminal-status-count { color: var(--terminal-success); }
.terminal-status-value.terminal-status-date { color: var(--terminal-text); }
.access-log-panel { margin-top: 34px; }
.access-log-panel h2 { margin: 0 0 8px; color: var(--terminal-text); font: 700 16px/1.4 var(--mono); }
.access-log { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; border: 1px solid var(--terminal-border); border-radius: 5px; background: var(--terminal-input); }
.access-log > .manage-note { padding: 14px; }
.access-log-row { display: grid; grid-template-columns: 170px minmax(160px, 190px) 150px minmax(280px, 1fr); min-width: 790px; border-bottom: 1px solid var(--terminal-border); font: 12px/1.45 var(--mono); }
.access-log-row:last-child { border-bottom: 0; }
.access-log-row span { min-width: 0; padding: 11px 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.access-log-heading { background: var(--terminal-header); color: var(--terminal-muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.access-log-cell-1 { display: flex; align-items: center; gap: 7px; overflow: visible !important; color: var(--terminal-success); white-space: normal !important; }
.access-log-cell-1 .country-flag { flex: 0 0 auto; padding: 0; overflow: visible; font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif; font-size: 16px; line-height: 1; }
.access-log-cell-1 .country-flag img { display: block; width: 22px; height: 15px; border: 1px solid rgba(0, 0, 0, .18); border-radius: 2px; object-fit: cover; }
.access-log-cell-1 .country-name { padding: 0; overflow: visible; text-overflow: clip; white-space: normal; }
.access-log-cell-2 { color: var(--terminal-text); }
.access-log-cell-3 { color: var(--terminal-muted); }
.delete-panel { margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--terminal-border); }
.delete-panel h2 { margin: 0 0 5px; color: var(--terminal-text); font: 700 16px/1.4 var(--mono); }
.delete-panel .manage-note { margin-bottom: 14px; }
.delete-button { border-color: var(--accent); border-radius: 4px; color: var(--accent); font-family: var(--mono); }
.delete-button:hover { background: var(--accent); color: #fff; }
.delete-confirmation { margin-top: 16px; padding: 16px; border: 1px solid var(--accent); border-radius: 5px; background: var(--terminal-input); color: var(--terminal-text); font: 13px/1.6 var(--mono); }
.delete-confirmation code { color: var(--accent); font: inherit; font-weight: 800; }
.delete-confirm-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.delete-confirm-actions input { min-width: 0; flex: 1; height: 34px; padding: 0 10px; border: 1px solid var(--terminal-border); border-radius: 4px; background: var(--terminal-surface); color: var(--terminal-text); font: 13px/1 var(--mono); }
.delete-confirm-actions input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.delete-confirm-actions button { min-height: 34px; padding: 0 11px; }
.delete-confirm-actions .delete-button:disabled { cursor: not-allowed; opacity: .45; }
.manual-page, .contact-page { padding-top: clamp(44px, 8vh, 80px); }
.manual-card, .contact-card { padding: 0; border: 0; border-radius: 9px; background: transparent; }
.manual-card .terminal-body, .contact-card .terminal-body { padding: clamp(24px, 4vw, 42px); }
.manual-card > .eyebrow, .manual-card > h1 { text-align: left; }
.manual-card h1 { margin: 0 0 22px; }
.manual-card h2 { color: var(--terminal-text); font-family: var(--mono); }
.manual-card p, .contact-card p { color: var(--terminal-muted); font-family: var(--mono); font-size: 13px; line-height: 1.8; }
.manual-card code { background: var(--terminal-input); color: var(--terminal-text); font-family: var(--mono); }
.manual-card pre { border-color: var(--terminal-border); border-radius: 5px; background: var(--terminal-input); }
.manual-card pre code { color: var(--terminal-success); }
.help-block { color: var(--terminal-text); }
.contact-card { text-align: left; }
.contact-card h1 { color: var(--terminal-text); font-family: var(--mono); }
.contact-value { align-items: center; gap: 9px; display: flex; margin: 18px 0 0; }
.contact-email { margin: 0; color: var(--terminal-success); font-family: var(--mono); font-size: clamp(19px, 3vw, 26px); }
.site-footer { padding: 22px 20px 28px; border-top-color: var(--terminal-border); background: var(--terminal-surface); color: var(--terminal-muted); font-family: var(--mono); }
.site-footer p { margin: 6px 0; }
.footer-ip span { color: var(--accent); font-family: var(--mono); }
.footer-status { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 7px 0; }
.footer-nav { margin: 0; gap: 8px; }
.site-footer a, .manual-card a { color: var(--terminal-success); }
.footer-nav span { color: var(--terminal-muted); }
:root[data-theme="powershell"] .site-footer { color: #d9ebff; }
:root[data-theme="powershell"] .site-footer a { color: #ffffff; font-weight: 700; text-decoration-color: #87e5dc; }
:root[data-theme="powershell"] .footer-nav span { color: #b9d8f5; }
.terminal-toast { position: fixed; right: 20px; bottom: 22px; z-index: 20; margin: 0; padding: 12px 14px; border: 1px solid var(--terminal-border); border-radius: 5px; background: var(--terminal-surface); color: var(--terminal-success); box-shadow: 0 12px 28px rgba(0,0,0,.2); font: 13px/1.4 var(--mono); }
.terminal-toast.error { color: var(--accent); }
.clipboard-helper { position: fixed; top: -9999px; left: -9999px; opacity: 0; }

@media (max-width: 767px) {
  .site-header { height: 58px; padding: 0 16px; }
  .brand { font-size: 15px; }
  .theme-control > span { display: none; }
  .theme-control select { font-size: 12px; }
  .landing { padding: 32px 13px 48px; }
  .terminal-body { padding: 22px 16px; }
  .terminal-window { max-width: 100%; }
  .terminal-bar { gap: 8px; padding: 0 11px; }
  .terminal-bar > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .shorten-form { align-items: stretch; flex-wrap: wrap; padding: 10px; }
  .command-prompt, .terminal-command { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .command-prompt { width: 100%; padding: 2px 0 0; }
  .shorten-form input { width: 100%; flex-basis: 100%; height: 78px !important; min-height: 78px; padding: 0 15px; border: 1px solid var(--terminal-border); border-left: 3px solid var(--accent); border-radius: 3px; background: var(--terminal-input); box-shadow: none; font-size: 16px; }
  .shorten-form input::placeholder { color: var(--terminal-muted); opacity: .82; }
  .shorten-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
  .shorten-form button { width: 100%; height: 42px; margin: 0; font-size: 14px; }
  .terminal-result-row { padding: 15px 14px; }
  .terminal-value { align-items: flex-start; flex-wrap: wrap; }
  .terminal-value > a, .terminal-value > input { width: calc(100% - 20px); flex-basis: calc(100% - 20px); font-size: 13px; overflow-wrap: anywhere; }
  .terminal-value > input { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .terminal-value .copy-button { min-height: 36px; margin-left: 20px; }
  .status-list.terminal-status .terminal-status-row { grid-template-columns: 1fr; }
  .terminal-status-key { padding: 8px 0 1px; }
  .terminal-status-value { padding: 1px 0 8px; }
  .access-log-panel { margin-top: 28px; }
  .access-log-row { min-width: 760px; }
  .delete-confirm-actions { flex-wrap: wrap; }
  .delete-confirm-actions input { flex-basis: 100%; }
  .delete-confirm-actions button { min-height: 38px; }
  .footer-status { gap: 6px; }
  .terminal-toast { right: 12px; bottom: max(14px, env(safe-area-inset-bottom)); left: 12px; }
}
