:root {
  --bg:#f3f2ec; --surface:#fffefa; --ink:#30372e; --dim:#6d7369; --line:#dddfd5;
  --accent:#394c3e; --accent-hover:#283b2d; --soft:#e8ece3; --error:#a03f32; --radius:12px;
  --serif:"Noto Serif SC","Source Han Serif SC","STSong","SimSun",serif;
  font-family:"Segoe UI","PingFang SC","Microsoft YaHei",system-ui,sans-serif;
  color:var(--ink); background:var(--bg); font-synthesis:none;
}
* { box-sizing:border-box }
body { margin:0; line-height:1.5 }
button,input,select { font:inherit }
button,a,input,select,summary { -webkit-tap-highlight-color:transparent }
button,a,summary { touch-action:manipulation }
button { cursor:pointer }
a { color:inherit; text-decoration:none }
button:disabled { cursor:wait; opacity:.55 }
button:focus-visible,a:focus-visible,summary:focus-visible { outline:2px solid var(--accent); outline-offset:4px }
input:focus,select:focus { outline:2px solid #91a188; outline-offset:2px }
[hidden] { display:none!important }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap }

/* A quiet shell keeps attention on the resume and its contents. */
.site-header { min-height:80px; padding:0 max(32px,calc((100vw - 1160px)/2)); display:flex; align-items:center; gap:56px; background:var(--surface); border-bottom:1px solid var(--line) }
.brand { display:flex; align-items:center; gap:12px; font-size:18px; font-weight:650; letter-spacing:.06em; white-space:nowrap }
.brand-mark { position:relative; width:28px; height:28px; display:block }
.brand-mark i { position:absolute; width:18px; height:23px; top:1px; left:1px; border:1.5px solid var(--accent); border-radius:3px 3px 7px 3px; background:var(--surface); transform:rotate(-9deg) }
.brand-mark i:last-child { left:9px; top:5px; width:17px; height:22px; background:var(--accent); border-color:var(--accent); transform:rotate(9deg) }
.brand-mark i:last-child::after { content:""; position:absolute; top:6px; left:4px; width:7px; height:1px; background:#dce4d5; box-shadow:0 4px #dce4d5 }
.main-nav { display:flex; align-items:center; gap:4px; padding:4px; border:1px solid #e5e7de; border-radius:9px; background:#f5f6f0 }
.main-nav button { border:0; border-radius:6px; padding:9px 20px; background:transparent; color:var(--dim); font-size:13px; transition:color .15s,background .15s }
.main-nav button:hover { color:var(--ink); background:#ebeee5 }
.main-nav button[aria-current=page] { background:var(--surface); color:var(--accent); box-shadow:0 1px 3px #26382912; font-weight:600 }
#account-area { margin-left:auto; display:flex; align-items:center; gap:16px; font-size:13px }
.account-name { max-width:160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:inline-flex; align-items:center; gap:8px }
.account-name::before { content:""; flex:0 0 6px; width:6px; height:6px; border-radius:50%; background:#7c9471 }
.container { max-width:1160px; padding:44px 32px 28px; margin:auto }
.page-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin-bottom:28px }
.eyebrow { display:flex; align-items:center; gap:8px; color:var(--dim); font-size:11px; letter-spacing:.1em; margin:0 0 14px }
.eyebrow-dot { width:6px; height:6px; background:#799270; border-radius:50% }
.page-heading h1 { font-size:34px; font-weight:550; letter-spacing:-.04em; line-height:1.3; margin:0 0 14px }
.template-page-heading h1 { font-family:var(--serif); font-size:clamp(30px,3vw,40px); font-weight:400; letter-spacing:.015em }
.template-page-heading h1 span { color:#677858; position:relative }
.template-page-heading h1 span::after { content:""; position:absolute; bottom:-3px; left:0; right:0; height:1px; background:#adb99d }
.page-heading p:not(.eyebrow) { color:var(--dim); font-size:13px; margin:0; line-height:1.8 }
.quiet-label { display:flex; align-items:center; gap:14px; color:var(--dim); font-size:11px; line-height:1.9; padding:0 0 7px 22px; border-left:1px solid var(--line); flex-shrink:0 }
.quiet-label strong { font-weight:400; color:#505e48 }
.quiet-symbol { font-size:38px; color:#7f9272; line-height:1; font-family:serif }
.btn { border:1px solid var(--line); border-radius:7px; background:var(--surface); color:var(--ink); min-height:40px; padding:9px 16px; display:inline-flex; align-items:center; justify-content:center; gap:10px; font-size:13px; line-height:1.4; white-space:nowrap; transition:background .15s,border-color .15s,transform .15s }
.btn:hover { background:#eef1e8; border-color:#c5cebd }
.btn:active { transform:translateY(1px) }
.btn-primary { background:var(--accent); border-color:var(--accent); color:#fffefa }
.btn-primary:hover { background:var(--accent-hover); border-color:var(--accent-hover) }
.btn-small { min-height:36px; padding:8px 13px; font-size:12px }
.btn-plain { border-color:transparent; background:transparent; color:var(--dim) }
.btn-full { width:100%; min-height:44px }
.btn-danger { background:var(--error); border-color:var(--error); color:#fff }
.btn-danger:hover { background:#873225; border-color:#873225 }
.text-button { border:0; background:none; color:var(--dim); font-size:12px; padding:8px; border-radius:5px }
.text-button:hover { color:var(--ink); background:var(--soft) }
.button-arrow { display:inline-block; font-size:17px; font-weight:400; transition:transform .18s }
.btn:hover .button-arrow { transform:translate(2px,-2px) }

/* Template previews and the project shelf. */
.template-grid { display:grid; grid-template-columns:1fr 1fr; gap:24px }
.template-card { border:1px solid var(--line); background:var(--surface); border-radius:var(--radius); overflow:hidden; transition:border-color .2s,box-shadow .2s }
.template-card:hover { border-color:#bfc9b6; box-shadow:0 6px 20px #34483009 }
.template-topline { display:flex; align-items:center; gap:10px; padding:14px 20px; font-size:11px; color:var(--dim); letter-spacing:.02em }
.template-index { font-family:Georgia,serif; font-size:15px; color:#79856e; font-style:italic }
.template-format { margin-left:auto; font-size:10px; color:#687463; border:1px solid #e1e5d9; border-radius:4px; padding:2px 6px; background:#f4f5ee }
.template-cover { display:block; width:calc(100% - 32px); margin:0 16px; padding:0; border:1px solid #e1ded4; border-radius:8px; background:#ece8e1; overflow:hidden; aspect-ratio:16/9; position:relative; cursor:zoom-in }
.template-cover img { width:100%; height:100%; display:block; object-fit:cover; transition:transform .35s ease }
.template-cover:hover img { transform:scale(1.015) }
.cover-preview { position:absolute; bottom:12px; right:12px; background:rgba(255,254,250,.96); border:1px solid #d9ded0; padding:7px 11px; border-radius:5px; color:var(--ink); font-size:11px; opacity:0; transform:translateY(3px); transition:opacity .18s,transform .18s }
.template-cover:hover .cover-preview,.template-cover:focus-visible .cover-preview { opacity:1; transform:translateY(0) }
.template-info { padding:22px 20px; display:flex; align-items:center; justify-content:space-between; gap:16px }
.template-info h2 { font-size:19px; font-weight:600; margin:0 0 7px; letter-spacing:.01em }
.template-info p { font-size:12px; color:var(--dim); margin:0; line-height:1.7; max-width:250px }
.template-use { flex-shrink:0 }
.template-card footer { border-top:1px solid #e6e8df; padding:13px 20px; display:flex; flex-wrap:wrap; gap:18px; color:#66715e; font-size:10px; background:#f9faf5 }
.template-card footer span { display:inline-flex; gap:6px; align-items:center }
.template-card footer span::before { content:""; display:block; width:4px; height:4px; border-radius:50%; background:#a0ae92 }
.workflow-note { display:flex; align-items:center; gap:32px; border-top:1px solid var(--line); border-bottom:1px solid var(--line); margin-top:28px; padding:19px 0; font-size:12px; color:var(--dim) }
.workflow-note span { display:flex; align-items:center; gap:10px }
.workflow-note b { font-family:Georgia,serif; color:#718166; font-size:13px; font-weight:400; font-style:italic }
.workflow-note em { font-size:11px; font-style:normal; margin-left:auto; color:#71796a }
.studio-footer { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-top:24px; color:#737c6c; font-size:11px }
.studio-footer>span { letter-spacing:.08em }
.studio-footer p { margin:0; font-family:var(--serif); letter-spacing:.06em }
.loading-message { padding:40px; color:var(--dim); font-size:13px }
.project-filters { display:flex; gap:12px; margin-bottom:24px }
.project-filters input { width:300px }
.project-filters input,.project-filters select { height:42px; border:1px solid var(--line); background:var(--surface); border-radius:7px; padding:9px 14px; font-size:13px; color:var(--ink) }
.project-filters input::placeholder { color:#7e8578 }
.project-list { padding:0; margin:0; list-style:none; display:flex; flex-direction:column; gap:12px }
.project-row { padding:22px; display:flex; align-items:center; gap:20px; border:1px solid var(--line); border-radius:10px; background:var(--surface); transition:border-color .2s }
.project-row:hover { border-color:#becbb5 }
.project-thumb { width:104px; height:68px; object-fit:cover; border:1px solid var(--line); border-radius:6px }
.project-text { min-width:0; flex:1 }
.project-text h2 { font-size:15px; font-weight:600; margin:0 0 9px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.project-meta { display:flex; flex-wrap:wrap; align-items:center; gap:10px; font-size:11px; color:var(--dim) }
.project-state { border:1px solid #dce1d4; padding:3px 7px; border-radius:4px; color:#617055; background:#f5f6f1 }
.project-state.published { background:#edf3e7; color:#4c633d; border-color:#d5e2c9 }
.unsent { color:#926c35 }
.project-buttons { display:flex; align-items:center; gap:8px }
.project-buttons>.btn:first-child { background:#eef2e8; border-color:#d8e0ce; color:#3c5533 }
.project-buttons>.btn:first-child:hover { background:#e4ecdb }
.action-menu { position:relative }
.action-menu summary { list-style:none; cursor:pointer }
.action-menu summary::-webkit-details-marker { display:none }
.menu-content { position:absolute; z-index:20; right:0; top:calc(100% + 8px); width:184px; padding:6px; border:1px solid var(--line); border-radius:8px; background:var(--surface); box-shadow:0 8px 24px #283b2912 }
.menu-content button { border:0; background:none; color:var(--ink); text-align:left; display:block; width:100%; font-size:12px; border-radius:5px; padding:11px 10px; min-height:40px }
.menu-content button:hover { background:var(--soft) }
.menu-content .danger-action { color:var(--error) }
.empty-state { padding:64px 24px; text-align:center; border:1px dashed #c8d0be; border-radius:var(--radius); background:#fcfcf7 }
.empty-state::before { content:""; display:block; width:30px; height:38px; border:1px solid #91a481; background:#eff3e8; border-radius:3px; box-shadow:5px 5px #e1e8d7; margin:0 auto 24px; transform:rotate(-5deg) }
.empty-state h2 { font-size:18px; margin:0 0 12px; font-weight:500 }
.empty-state p { font-size:13px; color:var(--dim); margin:0 auto 24px; line-height:1.8; max-width:440px }
.page-error,.form-error { color:var(--error); font-size:13px; line-height:1.7 }
.page-error { background:#fff4f0; border:1px solid #e3c6ba; border-radius:7px; padding:16px; margin-top:20px }
.page-error button { margin-left:14px }

/* The editor toolbar remains compact, with an explicit save status. */
.workbench { height:100dvh; display:flex; flex-direction:column; background:var(--surface) }
.workbench-header { padding:12px 20px; min-height:72px; display:flex; align-items:center; gap:16px; border-bottom:1px solid var(--line); position:relative; z-index:10; background:var(--surface); box-shadow:0 2px 12px #26382905 }
.workbench-name { display:flex; align-items:center; gap:12px; min-width:0; flex:1; padding-left:16px; border-left:1px solid var(--line) }
.workbench-name input { font-size:14px; font-weight:600; border:1px solid transparent; background:none; width:250px; max-width:100%; padding:8px 5px; border-radius:5px; min-width:60px; color:var(--ink) }
.workbench-name input:hover { border-color:var(--line); background:#f6f7f1 }
.workbench-name input:read-only { color:var(--dim) }
.template-tag { font-size:10px; color:#617355; border:1px solid #dce4d2; background:#f3f6ed; border-radius:4px; padding:4px 7px; white-space:nowrap }
.save-status { color:var(--dim); font-size:11px; white-space:nowrap; padding-right:8px }
.save-status[data-kind=error],.save-status[data-kind=conflict] { color:var(--error) }
.save-status[data-kind=saved]::before { content:""; display:inline-block; width:5px; height:5px; border-radius:50%; background:#829d6c; margin-right:6px; vertical-align:1px }
.save-status[data-kind=pending]::before { content:""; display:inline-block; width:5px; height:5px; border-radius:50%; background:#a28759; margin-right:6px; vertical-align:1px }
.workbench-tools { display:flex; align-items:center; gap:8px }
.editor-surface { position:relative; flex:1; min-height:0 }
.editor-surface iframe { display:block; width:100%; height:100%; border:0; background:var(--bg) }
.editor-loading { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; gap:12px; background:var(--bg); font-size:13px; color:var(--dim) }
.loading-dot { width:7px; height:7px; border-radius:50%; background:#839673; animation:breathe 1.4s ease-in-out infinite }
.conflict-banner { background:#fff3e9; border-bottom:1px solid #e5d3bb; padding:12px 20px; display:flex; gap:12px; align-items:center }
.conflict-banner p { margin:0; flex:1; font-size:12px; line-height:1.7; color:#806147 }

/* Native dialogs provide focus containment and keyboard dismissal. */
dialog { color:var(--ink); border:1px solid var(--line); padding:0; background:var(--surface); border-radius:12px; box-shadow:0 20px 70px #1e2f2326 }
dialog::backdrop { background:#28332c66; backdrop-filter:blur(3px) }
.small-dialog { width:440px; max-width:calc(100vw - 32px); max-height:calc(100dvh - 40px); padding:36px; position:fixed; overflow-y:auto }
.dialog-heading { margin-bottom:28px; padding-right:8px }
.dialog-heading .eyebrow { color:#667a57 }
.dialog-heading h2 { font-size:25px; font-weight:550; letter-spacing:-.02em; margin:0 0 12px }
.dialog-heading p:not(.eyebrow) { font-size:13px; color:var(--dim); line-height:1.8; margin:0 }
.close-dialog { position:absolute; top:14px; right:14px; width:32px; height:32px; border:1px solid transparent; border-radius:6px; font-size:22px; font-weight:300; background:none; color:var(--dim) }
.close-dialog:hover { background:var(--soft); border-color:var(--line) }
.auth-tabs { display:flex; border-bottom:1px solid var(--line); gap:28px; margin-bottom:24px }
.auth-tabs button { border:0; background:none; color:var(--dim); font-size:14px; padding:0 0 12px }
.auth-tabs [aria-pressed=true] { color:var(--accent); border-bottom:2px solid var(--accent); font-weight:600 }
.small-dialog label { display:flex; flex-direction:column; gap:9px; margin:0 0 18px; font-size:12px; font-weight:500 }
.small-dialog input { width:100%; height:44px; background:#fff; border:1px solid var(--line); border-radius:6px; padding:10px 12px; font-size:14px; color:var(--ink) }
.small-dialog input::placeholder { color:#747b6b; font-size:13px }
.small-dialog input[readonly] { background:#f1f3eb }
.form-hint { font-size:11px; color:var(--dim); line-height:1.8; margin:0 0 18px }
.form-error { margin:0 0 14px }
.dialog-actions { display:flex; gap:10px; justify-content:flex-end; margin:20px 0 }
.url-input { border:1px solid var(--line); border-radius:6px; background:#fff; padding:12px; display:flex; flex-direction:column; gap:6px; overflow:hidden }
.url-input>span { font-size:11px; color:var(--dim); overflow-wrap:anywhere }
.url-input input { padding:4px 0; height:30px; border:0; border-radius:0 }
.url-input input:focus { outline:none }
.url-input:focus-within { outline:2px solid #91a188; outline-offset:2px }
.url-input input[readonly] { background:#fff }
.preview-dialog { width:calc(100vw - 40px); max-width:none; height:calc(100dvh - 40px); max-height:none }
.preview-toolbar { height:60px; display:flex; gap:20px; align-items:center; padding:8px 20px; border-bottom:1px solid var(--line) }
.preview-toolbar strong { font-size:13px; font-weight:550; flex:1 }
.preview-sizes { display:flex; gap:3px; background:var(--soft); border-radius:6px; padding:3px }
.preview-sizes button { border:0; background:none; color:var(--dim); padding:6px 11px; font-size:12px; border-radius:4px }
.preview-sizes [aria-pressed=true] { background:var(--surface); color:var(--ink) }
.preview-surface { height:calc(100% - 60px); background:#e4e6dc; display:flex; justify-content:center; overflow:hidden }
.preview-surface iframe { width:100%; height:100%; border:0; background:#fff; transition:width .2s }
.preview-surface.mobile iframe { width:min(390px,100%) }
.toast-area { position:fixed; z-index:1000; bottom:24px; left:50%; transform:translateX(-50%); padding:0; margin:0; list-style:none; display:flex; flex-direction:column; gap:10px; pointer-events:none; max-width:calc(100vw - 32px) }
.toast { background:#344a38; color:#fff; padding:12px 20px; border-radius:7px; font-size:12px; line-height:1.7; box-shadow:0 3px 12px #24382615 }
.toast.error { background:#873e31 }
@keyframes breathe { 50% { opacity:.25 } }

@media(max-width:1000px) {
  .site-header { padding:0 28px; gap:32px }
  .quiet-label { display:none }
  .workbench-header { gap:10px; padding:9px 12px 16px }
  .workbench-name { padding-left:10px }
  .workbench-name input { width:180px }
  .template-tag { display:none }
  .save-status { position:absolute; left:170px; bottom:3px; font-size:10px }
  .workbench-tools { gap:5px }
  .workbench-tools .btn { padding:8px 11px }
  .template-info { gap:12px }
  .template-use { padding:9px 12px; font-size:12px }
}
@media(max-width:720px) {
  .site-header { min-height:72px; padding:0 20px; gap:20px; flex-wrap:wrap }
  .brand { font-size:16px; gap:8px }
  .brand-mark { width:25px; height:28px; transform:scale(.9); transform-origin:left center }
  .main-nav { gap:2px; padding:3px }
  .main-nav button { padding:8px 12px; font-size:12px }
  #account-area { gap:4px }
  .account-name { max-width:72px; font-size:11px }
  .account-name::before { display:none }
  .container { padding:32px 20px 24px }
  .page-heading { align-items:flex-start; margin-bottom:24px }
  .page-heading h1 { font-size:28px }
  .page-heading p:not(.eyebrow) { font-size:12px }
  .template-page-heading h1 { font-size:31px; line-height:1.4 }
  .template-grid { grid-template-columns:1fr; gap:20px }
  .template-topline { padding:13px 18px }
  .template-info { padding:20px 18px }
  .template-info h2 { font-size:18px }
  .template-card footer { padding:13px 18px; gap:16px }
  .cover-preview { opacity:1; transform:none; padding:6px 9px }
  .workflow-note { gap:12px; justify-content:space-between; flex-wrap:wrap; margin-top:24px; padding:17px 0; font-size:10px }
  .workflow-note span { gap:6px }
  .workflow-note em { width:100%; margin:0; font-size:10px; padding-top:2px }
  .studio-footer { margin-top:20px; font-size:10px }
  .project-filters { gap:8px; margin-bottom:18px }
  .project-filters .search-field { flex:1; min-width:0 }
  .project-filters input { width:100% }
  .project-filters select { max-width:112px; padding-right:8px }
  .project-row { padding:18px 16px; gap:12px; flex-wrap:wrap }
  .project-thumb { width:72px; height:48px }
  .project-buttons { width:100%; justify-content:flex-end; padding-top:4px }
  .project-text h2 { font-size:14px }
  .project-meta { gap:6px }
  .project-buttons .btn { font-size:11px; min-height:36px; padding:8px 12px }
  .workbench-header { min-height:104px; padding:8px 12px 10px; flex-wrap:wrap; column-gap:8px; row-gap:4px }
  .workbench-name { width:calc(100% - 60px); padding-left:10px }
  .workbench-name input { width:100% }
  .back-label { display:none }
  .workbench-header #editor-back { padding:8px; min-width:36px }
  .workbench-tools { width:100%; justify-content:flex-end; margin-left:auto; gap:6px }
  .workbench-tools .btn { min-height:34px; font-size:11px; padding:7px 12px }
  .save-status { left:18px; bottom:20px; font-size:10px; padding:0; max-width:120px; overflow:hidden; text-overflow:ellipsis }
  .desktop-action { display:none }
  .conflict-banner { padding:12px; flex-wrap:wrap; gap:8px }
  .conflict-banner p { flex:auto; width:100% }
  .small-dialog { padding:30px 24px }
  .dialog-heading h2 { font-size:23px }
  .preview-dialog { width:100vw; height:100dvh; border-radius:0; border:0 }
  .preview-toolbar { gap:10px; padding:8px 12px }
  .preview-toolbar strong { max-width:80px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
  .preview-sizes { margin-left:auto }
}
@media(max-width:560px) {
  .site-header { gap:0; padding:16px 20px 12px; row-gap:16px }
  .main-nav { order:3; width:100%; justify-content:center }
  .main-nav button { flex:1 }
  .brand { margin-right:auto }
  #account-area { margin-left:12px }
  .account-name { max-width:110px }
}
@media(max-width:380px) {
  .site-header { padding:14px 16px 12px }
  .brand { font-size:15px }
  #account-area .btn { padding:7px 10px; font-size:11px }
  .container { padding:28px 16px 24px }
  .template-page-heading h1 { font-size:27px }
  .template-info { gap:10px; padding:18px 16px }
  .template-info h2 { font-size:17px }
  .template-info p { font-size:11px }
  .template-use { padding:9px 10px; font-size:11px; gap:6px }
  .template-card footer { gap:13px; padding:12px 16px; font-size:9px }
  .workflow-note { font-size:9px; gap:9px }
  .workflow-note b { font-size:12px }
  .workbench-tools .btn { padding:7px 9px }
  .save-status { max-width:84px }
  .small-dialog { padding:28px 20px }
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important }
}
