/* The simulated desktop that opens /windows, and AI Finder's window on it.
   The window's layout comes from the Windows Explorer style mock-up the owner
   supplied. Everything else is drawn here: the wallpaper is our own, the start
   button is a neutral grid rather than any operating system's logo, and the
   window says AI Finder wherever a title would go. */
:root {
  --w-bg: #191919; --w-shell: #202020; --w-surface: #262626; --w-text: #f5f5f5;
  --w-sub: #bfbfbf; --w-line: #383838; --w-input: #303030; --w-hover: #383838;
  --w-selected: #314b62; --w-selected-edge: #3c657d; --w-nav: #383838;
  --w-blue: #60b4ff; --w-on-blue: #0b2338; --w-muted: #8a8a8a; --w-menu: #2c2c2c;
  --w-button: #333; --w-control: #4a4a4a; --w-progress: #4a4a4a; --w-mark: #5c4a12;
  --w-frame: #4a4a4a;
  --w-shadow: 0 8px 24px #00000066, 0 2px 5px #00000040;
  --wd-bar: rgba(30, 33, 42, .78); --wd-bar-text: #f3f4f6; --wd-bar-line: rgba(255,255,255,.09);
  --wd-bar-hover: rgba(255,255,255,.11); --wd-card: rgba(28, 31, 40, .78);
  --wd-card-text: #f4f5f7; --wd-card-sub: rgba(255,255,255,.72); --wd-card-line: rgba(255,255,255,.13);
  --wd-track: rgba(255,255,255,.2); --wd-wall: #0c1a33 url(/win/wallpaper-dark.svg);
  --wd-on-wall: #fff; --wd-on-wall-glow: 0 1px 3px rgba(0,0,0,.65);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --w-bg: #fff; --w-shell: #f3f3f3; --w-surface: #f9f9f9; --w-text: #1a1a1a;
    --w-sub: #5c5c5c; --w-line: #e5e5e5; --w-input: #fff; --w-hover: #ebebeb;
    --w-selected: #cce8ff; --w-selected-edge: #99d1ff; --w-nav: #eaeaea;
    --w-blue: #0067c0; --w-on-blue: #fff; --w-muted: #8f8f8f; --w-menu: #f9f9f9;
    --w-button: #fff; --w-control: #cfcfcf; --w-progress: #e0e0e0; --w-mark: #ffe9a8;
    --w-frame: #c7c7c7;
    --w-shadow: 0 8px 24px #00000025, 0 2px 5px #00000014;
    --wd-bar: rgba(243, 245, 249, .82); --wd-bar-text: #1b1f27; --wd-bar-line: rgba(0,0,0,.08);
    --wd-bar-hover: rgba(0,0,0,.06); --wd-card: rgba(250, 251, 253, .84);
    --wd-card-text: #1b1f27; --wd-card-sub: rgba(0,0,0,.66); --wd-card-line: rgba(0,0,0,.09);
    --wd-track: rgba(0,0,0,.14); --wd-wall: #cfe3f5 url(/win/wallpaper-light.svg);
    --wd-on-wall: #0e2036; --wd-on-wall-glow: 0 0 6px rgba(255,255,255,.75);
  }
}
:root[data-theme="light"] {
  --w-bg: #fff; --w-shell: #f3f3f3; --w-surface: #f9f9f9; --w-text: #1a1a1a;
  --w-sub: #5c5c5c; --w-line: #e5e5e5; --w-input: #fff; --w-hover: #ebebeb;
  --w-selected: #cce8ff; --w-selected-edge: #99d1ff; --w-nav: #eaeaea;
  --w-blue: #0067c0; --w-on-blue: #fff; --w-muted: #8f8f8f; --w-menu: #f9f9f9;
  --w-button: #fff; --w-control: #cfcfcf; --w-progress: #e0e0e0; --w-mark: #ffe9a8;
  --w-frame: #c7c7c7;
  --w-shadow: 0 8px 24px #00000025, 0 2px 5px #00000014;
  --wd-bar: rgba(243, 245, 249, .82); --wd-bar-text: #1b1f27; --wd-bar-line: rgba(0,0,0,.08);
  --wd-bar-hover: rgba(0,0,0,.06); --wd-card: rgba(250, 251, 253, .84);
  --wd-card-text: #1b1f27; --wd-card-sub: rgba(0,0,0,.66); --wd-card-line: rgba(0,0,0,.09);
  --wd-track: rgba(0,0,0,.14); --wd-wall: #cfe3f5 url(/win/wallpaper-light.svg);
  --wd-on-wall: #0e2036; --wd-on-wall-glow: 0 0 6px rgba(255,255,255,.75);
}

/* ---- The desktop ------------------------------------------------------- */
.wd {
  position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto 48px;
  background: var(--wd-wall) center bottom / cover no-repeat; overflow: hidden;
  font-family: 'Segoe UI Variable Text', 'Segoe UI', 'Malgun Gothic', 'Pretendard', 'Apple SD Gothic Neo', sans-serif;
  font-size: 12px; line-height: 1.5; color: var(--w-text); word-break: keep-all;
}
:where(.wd) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: default; }
.wd [hidden] { display: none !important; }
.wd :focus-visible { outline: 2px solid var(--w-blue); outline-offset: -2px; }
/* These fields draw their own focus line on the box around them. */
.wd .afw-search input:focus-visible, .wd .afw-aiform input:focus-visible, .wd .afw-rename:focus-visible, .wd .afw-crumbs input:focus-visible { outline: none; }
.wd .win-icon { width: 16px; height: 16px; display: inline-block; flex: none; vertical-align: middle; }

.wd-stage { grid-row: 1; position: relative; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 24px; padding: 28px 24px 12px 112px; }

.wd-shortcuts { position: absolute; left: 10px; top: 14px; width: 88px; display: grid; gap: 4px; z-index: 1; }
.wd-shortcut { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 4px 7px; border-radius: 4px; color: var(--wd-on-wall); text-align: center; font-size: 12px; line-height: 1.3; text-shadow: var(--wd-on-wall-glow); }
.wd-shortcut:hover { background: rgba(255, 255, 255, .16); }
.wd-shortcut img { width: 48px; height: 48px; }
.wd-shortcut .tile { width: 42px; height: 42px; margin: 3px; border-radius: 9px; }
.wd-shortcut > .win-icon { width: 42px; height: 42px; margin: 3px; }
.wd-shortcut .tile { display: flex; align-items: center; justify-content: center; color: var(--wd-on-wall); background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.34); }
.wd-shortcut .tile .win-icon { width: 24px; height: 24px; }

.wd-skip {
  position: absolute; z-index: 4; top: 14px; right: 16px; padding: 6px 15px; border-radius: 999px !important;
  font-size: 13px !important; color: rgba(255,255,255,.95) !important; background: rgba(0,0,0,.42) !important;
  border: 1px solid rgba(255,255,255,.3) !important; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.wd-skip:hover { background: rgba(0,0,0,.6) !important; }

.wd-legal {
  grid-row: 2; display: flex; flex-wrap: wrap; justify-content: center; gap: 1px 10px; padding: 0 16px 7px;
  font-size: 10px; line-height: 1.5; text-align: center; color: rgba(255,255,255,.72);
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.wd-legal a { color: rgba(255,255,255,.86); text-decoration: none; }
.wd-legal a:hover { color: #fff; text-decoration: underline; }
.wd-legal a.strong { font-weight: 700; color: #fff; }

.wd-greeting { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--wd-on-wall); text-align: center; text-shadow: var(--wd-on-wall-glow); }
.wd-greeting h2 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.wd-greeting div { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.wd-greeting button { padding: 8px 18px; border-radius: 4px; color: #fff; text-shadow: none; background: rgba(0,0,0,.52); border: 1px solid rgba(255,255,255,.3); }
.wd-greeting button:hover { background: rgba(0,0,0,.6); }

/* The guide is the same window the Mac tour uses, in this desktop's materials. */
.wd-guide {
  flex: 0 0 300px; align-self: center; border-radius: 8px; overflow: hidden; color: var(--wd-card-text);
  background: var(--wd-card); border: 1px solid var(--wd-card-line); box-shadow: 0 16px 40px rgba(0,0,0,.34);
  backdrop-filter: blur(30px) saturate(170%); -webkit-backdrop-filter: blur(30px) saturate(170%);
  font-family: 'Pretendard', 'Segoe UI Variable Text', 'Segoe UI', 'Malgun Gothic', sans-serif;
}
.wd-guide-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 32px; padding: 0 12px; font-size: 12px; color: var(--wd-card-sub); border-bottom: 1px solid var(--wd-card-line); }
.wd-guide-body { padding: 15px 18px 14px; }
.wd-guide-copy { min-height: 132px; }
.wd-guide-copy.enter { animation: wd-in 420ms cubic-bezier(.16, 1, .3, 1); }
@keyframes wd-in { from { opacity: 0; transform: translateY(6px); } }
.wd-eyebrow { font-size: 11.5px; letter-spacing: .04em; color: var(--wd-card-sub); font-variant-numeric: tabular-nums; }
.wd-guide h2 { margin: 6px 0; font-size: 19px; line-height: 1.35; letter-spacing: -.03em; font-weight: 700; }
.wd-guide p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--wd-card-sub); }
.wd-progress { display: flex; gap: 3px; margin-top: 14px; }
.wd-progress button { position: relative; flex: 1 1 0; height: 14px; }
.wd-progress button::after { content: ''; position: absolute; left: 0; right: 0; top: 5px; height: 3px; border-radius: 2px; background: var(--wd-track); transition: background 200ms ease; }
.wd-progress button.done::after { background: var(--wd-card-sub); }
.wd-progress button.on::after { background: var(--w-blue); }
.wd-controls { display: flex; justify-content: flex-end; gap: 6px; margin-top: 12px; }
.wd-controls button { padding: 5px 12px; border-radius: 4px; font-size: 12.5px; background: var(--wd-bar-hover); border: 1px solid var(--wd-card-line); }
.wd-controls button:hover { filter: brightness(1.15); }
.wd-hint { margin-top: 10px !important; font-size: 12px !important; line-height: 1.5 !important; }
.wd-hint:empty { display: none; }

/* A pointer that shows what the tour is doing. Only ever decoration. */
.wd-cursor { position: absolute; left: 0; top: 0; z-index: 30; width: 18px; height: 24px; pointer-events: none; opacity: 0; transition: transform 520ms cubic-bezier(.3, .7, .2, 1), opacity 200ms ease; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.wd-cursor.on { opacity: 1; }
.wd-cursor.press { filter: drop-shadow(0 0 5px var(--w-blue)); }

/* ---- Taskbar ----------------------------------------------------------- */
.wd-taskbar {
  grid-row: 3; position: relative; z-index: 6; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
  height: 48px; padding: 0 0 0 10px; color: var(--wd-bar-text); background: var(--wd-bar);
  border-top: 1px solid var(--wd-bar-line); backdrop-filter: blur(30px) saturate(170%); -webkit-backdrop-filter: blur(30px) saturate(170%);
}
.wd-brand { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; white-space: nowrap; overflow: hidden; }
.wd-brand img { width: 24px; height: 24px; flex: none; }
.wd-brand small { font-size: 11px; opacity: .72; overflow: hidden; text-overflow: ellipsis; }
.wd-tasks { display: flex; align-items: center; gap: 2px; }
.wd-task { position: relative; width: 44px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; }
.wd-task:hover, .wd-task[aria-expanded="true"] { background: var(--wd-bar-hover); }
.wd-task .win-icon { width: 22px; height: 22px; }
.wd-task img { width: 24px; height: 24px; }
.wd-task.running::after { content: ''; position: absolute; left: 50%; bottom: 3px; width: 6px; height: 3px; margin-left: -3px; border-radius: 2px; background: var(--wd-card-sub); }
.wd-task.active::after { width: 16px; margin-left: -8px; background: var(--w-blue); }
.wd-tasksearch { display: inline-flex; align-items: center; gap: 8px; width: 180px; height: 32px; margin: 0 6px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; color: var(--wd-card-sub); background: var(--wd-bar-hover); border: 1px solid var(--wd-bar-line) !important; }
.wd-tray { display: flex; align-items: center; justify-content: flex-end; gap: 2px; height: 100%; min-width: 0; }
.wd-tray button { height: 40px; padding: 0 8px; border-radius: 5px; }
.wd-tray button:hover, .wd-tray button[aria-expanded="true"] { background: var(--wd-bar-hover); }
.wd-tray .win-icon { width: 16px; height: 16px; }
.wd-oslink { padding: 0 8px; font-size: 12px; color: inherit; text-decoration: none; white-space: nowrap; }
.wd-oslink:hover { text-decoration: underline; }
.wd-clock { display: flex; flex-direction: column; align-items: flex-end; padding: 0 8px; font-size: 11.5px; line-height: 1.35; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wd-showdesk { width: 10px !important; height: 100% !important; margin-left: 4px; padding: 0 !important; border-radius: 0 !important; border-left: 1px solid var(--wd-bar-line) !important; }

.wd-start {
  position: absolute; z-index: 8; left: 50%; bottom: 58px; width: 340px; margin-left: -170px; padding: 14px 8px 8px;
  max-height: calc(100% - 72px); overflow: auto; color: var(--wd-card-text); background: var(--wd-card); border: 1px solid var(--wd-card-line);
  border-radius: 10px; box-shadow: 0 18px 48px rgba(0,0,0,.42); backdrop-filter: blur(34px) saturate(170%); -webkit-backdrop-filter: blur(34px) saturate(170%);
}
.wd-start-head { display: flex; align-items: center; gap: 10px; padding: 0 10px 12px; }
.wd-start-head img { width: 32px; height: 32px; }
.wd-start-head b { display: block; font-size: 14px; font-weight: 600; }
.wd-start-head span { font-size: 11.5px; color: var(--wd-card-sub); }
.wd-start p { margin: 8px 10px 4px; font-size: 11.5px; color: var(--wd-card-sub); }
.wd-start hr { border: 0; height: 1px; background: var(--wd-card-line); margin: 7px 8px; }
.wd-start button, .wd-start a { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 34px; padding: 6px 10px; border-radius: 4px; font-size: 12.5px; color: inherit; text-decoration: none; text-align: left; }
.wd-start button:hover, .wd-start a:hover { background: var(--wd-bar-hover); }
.wd-start kbd { font: inherit; font-size: 11px; color: var(--wd-card-sub); }

/* ---- The AI Finder window ---------------------------------------------- */
.afw { position: relative; flex: 0 1 1040px; min-width: 0; height: 100%; max-height: 760px; display: flex; flex-direction: column; overflow: hidden; color: var(--w-text); background: var(--w-bg); border: 1px solid var(--w-frame); border-radius: 8px; box-shadow: 0 24px 60px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.2); user-select: none; -webkit-user-select: none; -webkit-font-smoothing: auto; }
.wd.is-closing .afw, .wd.is-closing .wd-guide { opacity: 0; transform: scale(.94); transition: opacity 220ms ease, transform 220ms cubic-bezier(.4, 0, 1, 1); }
.afw button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 30px; padding: 5px 10px; border: 1px solid transparent; border-radius: 4px; white-space: nowrap; }
.afw button:hover:not(:disabled) { background: var(--w-hover); }
.afw button:active:not(:disabled) { opacity: .78; }
.afw button:disabled { color: var(--w-muted); opacity: .65; }
.afw input, .afw select { font: inherit; color: var(--w-text); }
.afw input::placeholder { color: var(--w-sub); }
.afw .tiny { width: 10px; height: 10px; }
.afw .icon { width: 36px; min-width: 36px; height: 32px; padding: 7px; }
.afw .tone-blue { color: #1584c4; } .afw .tone-green { color: #27a35c; } .afw .tone-purple { color: #8f57bd; } .afw .tone-orange { color: #d98735; }

.afw-title { display: flex; align-items: center; height: 40px; min-height: 40px; padding: 7px 0 0 8px; background: var(--w-shell); touch-action: none; }
.afw-tabs { display: flex; align-self: stretch; gap: 1px; min-width: 0; overflow: hidden; }
.afw-tabwrap { position: relative; display: flex; width: 216px; min-width: 96px; flex-shrink: 1; border-radius: 6px 6px 0 0; }
.afw-tabwrap.active { background: var(--w-bg); }
.afw-tabwrap:not(.active)::after { content: ''; position: absolute; right: 0; top: 8px; width: 1px; height: 16px; background: var(--w-line); }
.afw .afw-tab { justify-content: flex-start; width: 100%; padding: 7px 30px 7px 12px; gap: 10px; border-radius: 6px 6px 0 0; overflow: hidden; }
.afw-tab span { overflow: hidden; text-overflow: ellipsis; }
.afw-tabwrap.active .afw-tab:hover { background: var(--w-bg) !important; }
.afw .afw-tabclose { position: absolute; right: 4px; top: 4px; width: 24px; height: 24px; min-height: 24px; padding: 5px; }
.afw-tabclose .win-icon { width: 12px; height: 12px; }
.afw .afw-newtab { width: 30px; min-width: 30px; margin: 0 6px; align-self: center; transform: translateY(-3px); }
.afw-newtab .win-icon { width: 14px; height: 14px; }
.afw-brand { display: flex; align-items: center; gap: 6px; margin-left: auto; margin-right: 14px; padding-left: 10px; color: var(--w-sub); font-size: 11px; white-space: nowrap; transform: translateY(-3px); }
.afw-brand img { width: 16px; height: 16px; flex: none; }
.afw-brand b { font-weight: 600; color: var(--w-text); }
.afw-caption { display: flex; height: 39px; align-self: flex-start; margin-top: -7px; flex: none; }
.afw .afw-caption button { width: 46px; min-height: 39px; padding: 0; border: 0; border-radius: 0; }
.afw .afw-caption .close:hover { background: #c42b1c !important; color: #fff; }
.cap-min { width: 10px; height: 1px; background: currentColor; }
.cap-max { width: 10px; height: 10px; border: 1px solid currentColor; }
.cap-x { position: relative; width: 10px; height: 10px; }
.cap-x::before, .cap-x::after { content: ''; position: absolute; left: -1.5px; top: 4.5px; width: 13px; height: 1px; background: currentColor; transform: rotate(45deg); }
.cap-x::after { transform: rotate(-45deg); }

.afw-address { display: flex; align-items: center; gap: 10px; height: 50px; min-height: 50px; padding: 7px 12px; background: var(--w-shell); }
.afw-arrows { display: flex; gap: 4px; flex: none; }
.afw .afw-arrows .icon { width: 32px; min-width: 32px; }
.afw-menubtn { display: none !important; }
.afw-crumbs { position: relative; display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; height: 34px; padding: 0 4px 0 6px; border-radius: 4px; background: var(--w-input); overflow: hidden; }
.afw-crumbs > .win-icon { width: 10px; height: 10px; color: var(--w-sub); }
.afw .afw-crumbs button { min-height: 26px; padding: 2px 6px; font-size: 12px; flex: none; }
.afw .afw-crumbs .home { width: 26px; padding: 4px; }
.afw-crumbs .home .win-icon { width: 14px; height: 14px; color: var(--w-sub); }
.afw .afw-crumbs .edit { flex: 1; min-width: 8px; padding: 0; }
.afw .afw-crumbs .edit:hover { background: transparent !important; }
.afw-crumbs input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 6px 10px; border: 1px solid var(--w-blue); border-bottom-width: 2px; border-radius: 4px; background: var(--w-input); outline: none; }
.afw-search { display: flex; align-items: center; gap: 8px; width: 260px; min-width: 150px; height: 34px; padding: 0 8px 0 10px; border-radius: 4px; background: var(--w-input); border: 1px solid var(--w-line); }
.afw-search:focus-within { border-color: var(--w-blue); box-shadow: 0 0 0 1px var(--w-blue); }
.afw-search > .win-icon { width: 14px; height: 14px; color: var(--w-sub); }
.afw-search input { width: 100%; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; outline: none; user-select: text; -webkit-user-select: text; }
.afw .afw-search .icon { width: 23px; min-width: 23px; height: 26px; min-height: 26px; padding: 4px; }

.afw-commands { display: flex; align-items: center; flex: none; height: 51px; padding: 6px 12px; gap: 6px; border-bottom: 1px solid var(--w-line); background: var(--w-surface); }
.afw .afw-commands > button { height: 32px; padding: 5px 10px; }
.afw .afw-commands > .icon { width: 34px; min-width: 34px; padding: 7px; }
.afw-sep { width: 1px; height: 20px; margin: 0 4px; flex: none; background: var(--w-line); }
.afw-right { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.afw-right button[aria-pressed="true"] { background: var(--w-hover); }
/* With a panel open there is no room for four columns. */
.afw.has-panel .afw-list:not(.results) th:nth-child(3), .afw.has-panel .afw-list:not(.results) td:nth-child(3) { display: none; }
.afw.has-panel .afw-list:not(.results) th:nth-child(1) { width: 47%; }
.afw.has-panel .afw-list:not(.results) th:nth-child(2) { width: 34%; }
.afw.has-panel .afw-list:not(.results) th:nth-child(4) { width: 19%; }
.afw.has-panel .afw-list.results th:nth-child(1) { width: 42%; }
.afw.has-panel .afw-list.results th:nth-child(2) { width: 58%; }
.afw.has-panel .afw-list.results th:nth-child(3), .afw.has-panel .afw-list.results td:nth-child(3) { display: none; }
.afw-ai img, .afw-panelhead img { width: 16px; height: 16px; flex: none; }

.afw-body { position: relative; display: flex; flex: 1; min-height: 0; }
.afw-side { width: 196px; min-width: 144px; flex: none; display: flex; flex-direction: column; padding: 8px 5px 5px; overflow: auto; scrollbar-width: thin; background: var(--w-bg); }
.afw .afw-side > button { justify-content: flex-start; width: 100%; height: 32px; min-height: 32px; padding: 5px 8px; gap: 8px; text-align: left; flex: none; }
.afw-side .active { background: var(--w-nav); }
.afw .afw-side .sub { padding-left: 34px; font-size: 11.5px; }
.afw-side .pin { width: 11px; height: 11px; margin-left: auto; color: #878787; transform: rotate(-40deg); }
.afw-navline { flex: none; height: 1px; margin: 8px 7px; background: var(--w-line); }
.afw-resize { position: relative; width: 1px; flex: none; background: var(--w-line); }

.afw-files { position: relative; flex: 1; min-width: 0; overflow: auto; padding: 0 14px 24px; scrollbar-width: thin; }
.afw-scrim { display: none; }
.afw-list { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0 1px; }
.afw-list th { position: sticky; top: 0; z-index: 1; height: 32px; padding: 0 12px; font-weight: 400; text-align: left; color: var(--w-sub); background: var(--w-bg); border-bottom: 1px solid var(--w-line); }
.afw-list th::after { content: ''; position: absolute; right: 0; top: 8px; width: 1px; height: 16px; background: var(--w-line); }
.afw-list th:last-child::after { display: none; }
.afw-list th:hover { background: var(--w-hover); }
.afw-list th:nth-child(1) { width: 42%; padding-left: 9px; }
.afw-list th:nth-child(2) { width: 25%; }
.afw-list th:nth-child(3) { width: 19%; }
.afw-list th:nth-child(4) { width: 14%; }
.afw-list.results th:nth-child(1) { width: 36%; }
.afw-list.results th:nth-child(2) { width: 44%; }
.afw-list.results th:nth-child(3) { width: 20%; }
.afw .afw-list th button { justify-content: flex-start; width: 100%; min-height: 28px; padding: 0; }
.afw .afw-list th button:hover { background: transparent !important; }
.afw-list th .win-icon { width: 10px; height: 10px; margin-left: auto; }
.afw-list td { height: 31px; padding: 0 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-top: 1px solid transparent; border-bottom: 1px solid transparent; }
.afw-list td:first-child { padding-left: 8px; border-left: 1px solid transparent; border-radius: 3px 0 0 3px; }
.afw-list td:last-child { border-right: 1px solid transparent; border-radius: 0 3px 3px 0; }
.afw-list td:not(:first-child) { color: var(--w-sub); }
.afw-list:not(.results) td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.afw-list tbody tr:hover td { background: var(--w-hover); }
.afw-list tbody tr.selected td { background: var(--w-selected); border-top-color: var(--w-selected-edge); border-bottom-color: var(--w-selected-edge); }
.afw-list tbody tr.selected td:first-child { border-left-color: var(--w-selected-edge); }
.afw-list tbody tr.selected td:last-child { border-right-color: var(--w-selected-edge); }
.afw-list tbody tr.selected td:not(:first-child) { color: var(--w-text); }
.afw-list tbody tr.cut { opacity: .45; }
.afw-list mark { color: inherit; background: var(--w-mark); border-radius: 2px; padding: 0 1px; }
.afw .afw-file { justify-content: flex-start; width: 100%; min-height: 28px; padding: 0; gap: 8px; border: 0; border-radius: 0; }
.afw .afw-file:hover { background: transparent !important; }
.afw-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.afw-file .shell-icon { width: 18px; height: 18px; }
.file-glyph { width: 18px; height: 20px; flex: none; }
.afw-rename { width: 100%; height: 23px; padding: 1px 3px; border: 1px solid var(--w-blue); outline: none; background: var(--w-bg); user-select: text; -webkit-user-select: text; }
.afw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; padding: 15px 0; }
.afw .afw-griditem { flex-direction: column; justify-content: flex-start; min-height: 122px; padding: 14px 7px 7px; gap: 10px; white-space: normal; }
.afw-griditem .win-icon, .afw-griditem .file-glyph { width: 52px; height: 52px; }
.afw-griditem span { width: 100%; max-height: 38px; overflow: hidden; overflow-wrap: anywhere; text-align: center; }
.afw .afw-griditem.selected { background: var(--w-selected); border-color: var(--w-selected-edge); }
.afw.compact .afw-list td { height: 24px; }
.afw.compact .afw-file { min-height: 22px; }

.afw-info { padding: 12px 0 11px; color: var(--w-sub); border-bottom: 1px solid var(--w-line); line-height: 1.6; }
.afw-info b { font-weight: 600; color: var(--w-text); }
.afw-empty { padding: 55px 10px; text-align: center; color: var(--w-sub); }
.afw-hometitle { margin: 20px 0 14px; font-size: 13px; font-weight: 600; }
.afw-homegrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; margin: 0 4px 12px; }
.afw .afw-homegrid button { justify-content: flex-start; min-height: 60px; padding: 8px 10px; gap: 12px; }
.afw-homegrid .win-icon { width: 34px; height: 34px; }
.afw-homegrid span { display: block; text-align: left; }
.afw-homegrid small { display: block; padding-top: 2px; font-size: 11px; color: var(--w-sub); }
.afw-drive { display: flex; align-items: center; gap: 14px; max-width: 420px; padding: 12px 10px; }
.afw-drive > .win-icon { width: 40px; height: 40px; color: #607785; }
.afw-drive > div { flex: 1; }
.afw-meter { display: block; height: 10px; margin: 6px 0; border-radius: 5px; overflow: hidden; background: var(--w-progress); }
.afw-meter i { display: block; height: 100%; border-radius: 5px; background: var(--w-blue); }
.afw-drive small { color: var(--w-sub); }
.afw-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 4px; }
.afw-stat { padding: 14px; border: 1px solid var(--w-line); border-radius: 6px; background: var(--w-surface); }
.afw-stat b { display: block; margin-top: 2px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.afw-stat small { color: var(--w-sub); }
.afw-apps { width: 100%; margin-top: 14px; border-collapse: collapse; }
.afw-apps th { padding: 8px; font-weight: 400; text-align: left; color: var(--w-sub); border-bottom: 1px solid var(--w-line); }
.afw-apps td { padding: 9px 8px; border-bottom: 1px solid var(--w-line); }
.afw-apps td:last-child, .afw-apps th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.afw-note { margin-top: 12px; font-size: 11.5px; color: var(--w-sub); }

.afw-panel { width: 280px; flex: none; display: flex; flex-direction: column; padding: 16px 18px; overflow: auto; border-left: 1px solid var(--w-line); background: var(--w-bg); scrollbar-width: thin; }
.afw-panelhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: 14px; font-weight: 600; }
.afw-panelhead > span { display: flex; align-items: center; gap: 8px; }
.afw .afw-panelhead .icon { width: 26px; min-width: 26px; height: 26px; min-height: 26px; padding: 0; }
.afw-panelhead .icon .win-icon { width: 12px; height: 12px; }
.afw-preview { flex: none; display: flex; align-items: center; justify-content: center; height: 132px; margin-bottom: 16px; border-radius: 5px; background: var(--w-shell); }
.afw-preview .win-icon, .afw-preview .file-glyph { width: 60px; height: 70px; }
.afw-filename { margin: 0 0 3px; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.afw-meta { display: grid; grid-template-columns: 62px 1fr; gap: 10px 8px; margin: 16px 0; }
.afw-meta dt { color: var(--w-sub); }
.afw-meta dd { margin: 0; overflow-wrap: anywhere; }
.afw-excerpt { margin: 0 0 12px; padding: 10px 11px; border-radius: 5px; line-height: 1.7; background: var(--w-shell); user-select: text; -webkit-user-select: text; }
.afw-excerpt small { display: block; margin-bottom: 3px; color: var(--w-sub); }
.afw-excerpt mark { color: inherit; background: var(--w-mark); border-radius: 2px; padding: 0 1px; }
.afw .afw-secondary { justify-content: flex-start; min-height: 34px; margin-top: 6px; padding: 7px 12px; flex: none; border: 1px solid var(--w-line); background: var(--w-button); }
.afw-panel p { margin: 6px 0 14px; color: var(--w-sub); line-height: 1.75; }
.afw-aihead { margin: 16px 0 4px; font-size: 19px; line-height: 1.45; font-weight: 600; letter-spacing: -.3px; }
.afw .afw-prompt { justify-content: flex-start; flex: none; min-height: 36px; margin: 4px 0; padding: 8px 11px; white-space: normal; text-align: left; border: 1px solid var(--w-line); background: var(--w-button); }
.afw-privacy { display: flex; align-items: center; gap: 6px; margin: 14px 0 10px; font-size: 11.5px; color: var(--w-sub); }
.afw-privacy .win-icon { width: 14px; height: 14px; }
.afw-aiform { display: flex; align-items: center; flex: none; margin-top: auto; min-height: 42px; border: 1px solid var(--w-line); border-radius: 5px; background: var(--w-input); }
.afw-aiform input { width: 100%; min-width: 0; padding: 10px; border: 0; background: transparent; outline: none; user-select: text; -webkit-user-select: text; }
.afw .afw-aiform button { width: 30px; min-width: 30px; height: 30px; min-height: 30px; margin: 4px; padding: 0; color: var(--w-on-blue); background: var(--w-blue) !important; }
.afw-answer { margin: 8px 0; padding: 11px 12px; border-radius: 5px; line-height: 1.75; background: var(--w-shell); user-select: text; -webkit-user-select: text; }
.afw-answer small { display: block; margin-bottom: 4px; color: var(--w-sub); }
.afw-maskrow { display: block; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--w-line); }
.afw-masked { padding: 0 5px; border-radius: 3px; font-size: 11px; color: var(--w-on-blue); background: var(--w-blue); white-space: nowrap; }

.afw-status { display: flex; align-items: center; gap: 15px; flex: none; height: 29px; padding: 0 12px 0 15px; font-size: 11px; color: var(--w-sub); border-top: 1px solid var(--w-line); }
.afw-message { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.afw-sample { margin-left: auto; white-space: nowrap; }
.afw-viewbtns { display: flex; }
.afw .afw-status .icon { width: 27px; min-width: 27px; height: 25px; min-height: 25px; padding: 5px; border-radius: 2px; }
.afw-status .icon .win-icon { width: 14px; height: 14px; }
.afw-status button[aria-pressed="true"] { background: var(--w-nav); }

.afw-menu { position: absolute; z-index: 50; width: 244px; max-width: calc(100% - 14px); max-height: calc(100% - 18px); padding: 4px; overflow: auto; border: 1px solid var(--w-line); border-radius: 8px; background: var(--w-menu); box-shadow: var(--w-shadow); }
.afw .afw-menu > button { justify-content: flex-start; width: 100%; min-height: 32px; padding: 6px 10px; gap: 12px; }
.afw-menu .slot { display: inline-flex; width: 16px; height: 16px; flex: none; }
.afw-menu kbd { margin-left: auto; font: inherit; font-size: 11px; color: var(--w-sub); }
.afw-menu hr { height: 1px; margin: 5px 0; border: 0; background: var(--w-line); }

.afw-modal { position: absolute; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 22px; background: #00000030; }
.afw-dialog { width: 440px; max-width: 100%; max-height: 100%; overflow: auto; border: 1px solid var(--w-line); border-radius: 8px; background: var(--w-bg); box-shadow: var(--w-shadow); }
.afw-dialogbody { padding: 18px 24px 22px; }
.afw-dialogtag { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; font-size: 11.5px; color: var(--w-sub); }
.afw-dialogtag img { width: 16px; height: 16px; }
.afw-dialog h2 { margin: 0 0 10px; font-size: 18px; line-height: 1.45; font-weight: 600; letter-spacing: -.3px; }
.afw-dialog p { margin: 8px 0; color: var(--w-sub); line-height: 1.8; }
.afw-dialog small { font-size: 11.5px; color: var(--w-sub); }
.afw-dialog label { display: block; }
.afw-dialog input[type="text"], .afw-dialog select { display: block; width: 100%; height: 34px; margin: 7px 0 14px; padding: 6px 10px; border: 1px solid var(--w-control); border-radius: 4px; background: var(--w-input); }
.afw-dialog input[type="text"] { user-select: text; -webkit-user-select: text; }
.afw-dialogfoot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; background: var(--w-shell); border-top: 1px solid var(--w-line); }
.afw .afw-dialogfoot button, .afw .afw-dialogfoot a { min-width: 92px; padding: 6px 14px; border: 1px solid var(--w-control); background: var(--w-button); }
.afw .afw-dialogfoot .primary { color: var(--w-on-blue); background: var(--w-blue); border-color: transparent; }
.afw .afw-dialogfoot .primary:hover { background: var(--w-blue) !important; filter: brightness(1.08); }
.afw-check { display: flex !important; align-items: flex-start; gap: 9px; margin: 12px 0; line-height: 1.6; }
.afw-check input { width: 16px; height: 16px; margin: 3px 0 0; flex: none; accent-color: var(--w-blue); }
.afw-check small { display: block; padding-top: 1px; }
.afw-row { display: grid; grid-template-columns: 1fr 150px; align-items: center; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--w-line); }
.afw-row select { margin: 0 !important; }
.afw-history { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--w-line); }
.afw-history small { margin-left: auto; }

/* ---- States ------------------------------------------------------------ */
.wd.is-max .wd-stage { padding: 0; }
.wd.is-max .afw { flex: 1 1 100%; max-height: none; border: 0; border-radius: 0; }
.wd.is-max .wd-guide { position: absolute; right: 16px; bottom: 44px; z-index: 5; width: 300px; }
.wd.is-max .wd-shortcuts, .wd.is-max .wd-legal, .wd.is-max .wd-skip { display: none; }
.wd.is-gone .afw { display: none; }
.wd.is-gone .wd-stage { justify-content: flex-end; }

/* ---- Narrower screens --------------------------------------------------- */
@media (max-width: 1240px) {
  .wd-shortcuts { display: none; }
  .wd-stage { padding-left: 24px; }
}
@media (max-width: 1100px) {
  .afw-side { width: 176px; }
  .afw-panel { width: 250px; padding: 14px; }
  .afw-brand small { display: none; }
  .afw .afw-commands { gap: 2px; }
  .afw .afw-commands > .icon { width: 30px; min-width: 30px; }
  .afw-right > button { padding: 5px 7px; }
  /* The guide goes under the window, and the copy drops its reserved height. */
  .wd-stage { flex-direction: column; gap: 10px; padding: 52px 16px 8px; }
  .afw { flex: 1 1 auto; width: 100%; max-width: 1040px; height: auto; max-height: none; }
  .wd-guide { flex: none; align-self: center; width: min(560px, 100%); }
  .wd-guide-copy { min-height: 0; }
  .wd-brand small { display: none; }
  .wd-tasksearch { width: 40px; padding: 0 12px; }
  .wd-tasksearch span { display: none; }
}
@media (max-width: 900px) {
  .afw-basic { display: none !important; }
  .afw-brand { display: none; }
  .afw-caption { margin-left: auto; }
  .afw-search { width: 190px; }
  .afw-address { gap: 7px; padding: 7px 8px; }
  .afw-list th:nth-child(3), .afw-list td:nth-child(3) { display: none; }
  .afw-list th:nth-child(1) { width: 58%; }
  .afw-list th:nth-child(2) { width: 42%; }
  .afw-list.results th:nth-child(1) { width: 44%; }
  .afw-list.results th:nth-child(2) { width: 56%; }
}
/* Phone. The side panel leaves the row and comes in over the files, which
   keeps every file name readable instead of shrinking the window to fit. */
@media (max-width: 680px) {
  .wd { grid-template-rows: minmax(0, 1fr) auto 52px; }
  .wd-stage { padding: 50px 8px 6px; gap: 8px; }
  .wd-skip { top: 10px; right: 10px; }
  .wd-cursor { display: none; }
  .wd-brand small { display: none; }
  .wd-taskbar { height: 52px; padding: 0; grid-template-columns: auto minmax(0, 1fr) auto; }
  .wd-brand { display: none; }
  .wd-tasks { justify-content: flex-start; padding-left: 4px; }
  .wd-task { width: 42px; height: 46px; }
  .wd-tasksearch { width: 42px; margin: 0; padding: 0 11px; border: 0 !important; background: none; }
  .wd-tray .wd-opt { display: none; }
  .wd-showdesk { display: none; }
  .wd-start { left: 8px; right: 8px; width: auto; margin: 0; bottom: 60px; }
  .wd-legal { padding: 0 10px 6px; gap: 0 8px; font-size: 9.5px; line-height: 1.45; }

  .wd-guide { width: 100%; }
  .wd-guide-bar { display: none; }
  .wd-guide-body { padding: 10px 12px 9px; }
  .wd-guide h2 { margin: 2px 0 3px; font-size: 16px; }
  .wd-guide p { font-size: 13px; line-height: 1.5; }
  .wd-progress { margin-top: 8px; }
  .wd-controls { margin-top: 6px; }

  .afw-title { padding-left: 4px; }
  .afw-tabwrap { width: 132px; min-width: 88px; }
  .afw .afw-tab { padding-left: 8px; gap: 6px; }
  .afw .afw-newtab { width: 28px; min-width: 28px; margin: 0 2px; }
  .afw .afw-caption .opt { display: none; }
  .afw .afw-caption button { width: 40px; }
  .afw-address { flex-wrap: wrap; height: auto; min-height: 0; gap: 5px; padding: 5px 6px 6px; }
  .afw-menubtn { display: inline-flex !important; }
  .afw .afw-arrows .icon { width: 34px; min-width: 34px; }
  .afw .afw-arrows .opt { display: none; }
  .afw-arrows { gap: 0; }
  .afw-crumbs { flex: 1 1 40%; }
  .afw-search { flex: 1 1 100%; width: 100%; height: 34px; }
  .afw-search input { font-size: 16px; }
  .afw-commands { height: 42px; padding: 4px 6px; gap: 0; overflow-x: auto; scrollbar-width: none; }
  .afw-commands::-webkit-scrollbar { display: none; }
  .afw .afw-commands > button { padding: 5px 7px; flex: none; }
  .afw-commands .afw-sep { display: none; }
  .afw-right { gap: 0; flex: none; }
  .afw-right > button { padding: 5px 7px; }
  .afw-right > button span { display: none; }

  .afw-side { position: absolute; left: 0; top: 0; bottom: 0; z-index: 30; width: 214px; transform: translateX(-102%); transition: transform 180ms ease; box-shadow: 8px 0 24px rgba(0,0,0,.25); visibility: hidden; }
  .afw.side-open .afw-side { transform: none; visibility: visible; }
  .afw.side-open .afw-scrim { display: block; position: absolute; inset: 0; z-index: 29; background: #00000040; }
  .afw .afw-side > button { height: 38px; min-height: 38px; }
  .afw-resize { display: none; }

  .afw-files { padding: 0 6px 16px; }
  .afw-list th, .afw-list td { padding: 0 5px; }
  .afw-list th:nth-child(2), .afw-list td:nth-child(2) { display: none; }
  .afw-list th:nth-child(1) { width: 72%; }
  .afw-list th:nth-child(4) { width: 28%; }
  .afw-list td { height: 38px; }
  .afw .afw-file { min-height: 34px; }
  /* In results the excerpt is the point, so it stays and the folder goes. */
  .afw-list.results th:nth-child(2), .afw-list.results td:nth-child(2) { display: table-cell; }
  .afw-list.results th:nth-child(3), .afw-list.results td:nth-child(3) { display: none; }
  .afw-list.results th:nth-child(1) { width: 46%; }
  .afw-list.results th:nth-child(2) { width: 54%; }
  .afw-homegrid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; gap: 2px; }
  .afw .afw-homegrid button { min-height: 50px; padding: 6px; gap: 8px; }
  .afw-homegrid .win-icon { width: 28px; height: 28px; }
  .afw-hometitle { margin: 12px 0 8px; }
  .afw-stats { grid-template-columns: 1fr; gap: 6px; }
  .afw-stat { padding: 9px 12px; }
  .afw-stat b { font-size: 18px; }

  .afw-panel { position: absolute; inset: 0 0 0 auto; z-index: 28; width: min(320px, 100%); box-shadow: -5px 0 20px rgba(0,0,0,.22); }
  .afw-status { gap: 10px; padding: 0 7px; }
  .afw-message { display: none; }
  .afw-sample { font-size: 10.5px; }
  .afw-modal { padding: 10px; }
  .afw-dialogbody { padding: 14px 16px 16px; }
  .afw-dialogfoot { padding: 10px 16px; }
  .afw .afw-dialogfoot button { min-width: 76px; }
  .afw-row { grid-template-columns: 1fr 124px; }
  .afw-dialog input[type="text"] { font-size: 16px; }
}
@media (max-height: 720px) and (max-width: 680px) {
  .wd-legal { display: none; }
  .wd-guide p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .wd-hint { display: none; }
}
@media (max-height: 760px) and (min-width: 1101px) {
  .wd-legal { padding-bottom: 4px; font-size: 9.5px; }
  .wd-guide-copy { min-height: 118px; }
}
@media (prefers-reduced-motion: reduce) {
  .wd *, .wd *::before, .wd *::after { transition: none !important; animation: none !important; }
}
