/* Excel Editor page: title bar over the spreadsheet engine, File backstage, start screen extras, focus mode. */

.layout-app [data-app-page="excel-editor"] .app-work { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.xe-host { flex: 1; min-height: 0; position: relative; }
.xe-veil { position: absolute; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; gap: .6rem; background: var(--surface); color: var(--text-soft); font-size: .95rem; }
.xe-veil-spin { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: #217346; border-radius: 50%; animation: xe-spin .8s linear infinite; }
@keyframes xe-spin { to { transform: rotate(360deg); } }

.xr-title { display: flex; align-items: center; gap: .4rem; min-height: 44px; padding: .3rem .75rem; background: var(--surface); border-bottom: 1px solid var(--border); font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif; font-size: 13px; }
.xr-logo { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: #217346; color: #fff; }
.xr-logo .icon { width: 17px; height: 17px; }
.xr-file { height: 30px; padding: 0 .7rem; border: 0; border-radius: 6px; background: none; color: #217346; font: inherit; font-weight: 600; cursor: pointer; }
html[data-theme="dark"] .xr-file { color: #6fcf97; }
.xr-file:hover, .xr-btn:hover, .xr-eden:hover { background: var(--surface-2); }
.xr-name { min-width: 6ch; max-width: 40ch; field-sizing: content; padding: .25rem .45rem; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; }
.xr-name:hover { border-color: var(--border); }
.xr-name:focus { outline: none; border-color: #217346; }
.xr-saved { color: var(--text-soft); font-size: 12px; white-space: nowrap; }
.xr-grow { flex: 1; }
.xr-btn { display: inline-flex; align-items: center; gap: .35rem; height: 32px; padding: 0 .6rem; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; cursor: pointer; }
.xr-btn .icon, .xr-download .icon { width: 17px; height: 17px; }
.xr-download { display: inline-flex; align-items: center; gap: .4rem; height: 32px; padding: 0 .9rem; border: 0; border-radius: 6px; background: #217346; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.xr-download:hover { filter: brightness(1.1); }
.xr-eden { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: none; cursor: pointer; animation: xr-eden-in .28s ease; }
.xr-eden[hidden] { display: none; }
.xr-eden svg { width: 28px; height: 28px; }
@keyframes xr-eden-in { from { opacity: 0; transform: translateX(-8px); } }
@media (max-width: 760px) { .xr-btn span, .xr-download span, .xr-saved { display: none; } }

/* focus mode (same as the Word Editor): the site header slides away */
.site-header { transition: margin-top .28s ease, opacity .22s ease; }
.app-frame { transition: height .28s ease, min-height .28s ease; }
html.we-focus .site-header { margin-top: calc(-1 * var(--we-hh, 64px)); opacity: 0; pointer-events: none; }
html.we-focus .app-frame { height: 100dvh !important; min-height: 100dvh !important; }
.site-header .brand:has(+ .we-focus-btn) { margin-right: 0; }
.we-focus-btn { display: inline-grid; flex: none; place-items: center; width: 34px; height: 34px; margin-left: .5rem; margin-right: auto; padding: 7px; border: 0; border-radius: 8px; background: none; color: var(--text-soft); cursor: pointer; }
.we-focus-btn[hidden] { display: none; }
.we-focus-btn:hover { background: var(--surface-2); color: var(--text); }
.we-focus-btn .icon { width: 100%; height: 100%; }

/* File backstage */
.xb { position: fixed; inset: 0; z-index: 900; display: flex; background: var(--surface); color: var(--text); animation: xb-in .18s ease-out; font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif; }
@keyframes xb-in { from { opacity: 0; transform: translateX(-12px); } }
.xb-nav { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; width: 200px; padding: .9rem .75rem; background: #217346; color: #fff; }
.xb-back { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: #fff; cursor: pointer; }
.xb-back:hover { background: rgba(255,255,255,.15); }
.xb-back .icon { width: 20px; height: 20px; }
.xb-title { font-size: 1.3rem; padding-left: .5rem; }
.xb-main { flex: 1; overflow: auto; padding: 1.25rem 2rem 3rem; }
.xb-main h2 { margin: 1.25rem 0 .6rem; font-size: 1.05rem; font-weight: 600; }
.xb-main h2:first-child { margin-top: 0; }
.xb-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.xb-big { display: flex; align-items: center; gap: 1rem; width: 100%; max-width: 560px; margin-bottom: .45rem; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.xb-big:hover { border-color: #217346; background: color-mix(in srgb, #217346 8%, var(--surface)); }
.xb-big .icon { width: 24px; height: 24px; color: #217346; flex: none; }
.xb-big span { display: flex; flex-direction: column; gap: .1rem; }
.xb-big small { color: var(--text-soft); font-size: .82rem; }
@media (max-width: 700px) { .xb { flex-direction: column; } .xb-nav { width: auto; flex-direction: row; align-items: center; } .xb-main { padding: 1rem; } }

.xe-chart-preview { width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }

/* start screen */
.xe-start { display: flex; flex-direction: column; align-items: center; gap: 1rem; margin-top: 1rem; }
.xe-templates { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.xe-recent { width: min(520px, 100%); }
.xe-recent-title { margin: .25rem 0 .4rem; font-size: .95rem; font-weight: 600; color: var(--text-soft); }
.xe-recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.xe-recent-item { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .55rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.xe-recent-item:hover { border-color: var(--primary); background: var(--primary-softer); }
.xe-recent-item span { display: flex; flex-direction: column; min-width: 0; }
.xe-recent-item strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xe-recent-item small { color: var(--text-soft); font-size: .82rem; }
