/* Seeklet Drive preview. Colours, fonts, buttons and tags come from pricing.css. */

html { color-scheme: dark; }
[hidden] { display: none !important; }
body.drive { height: 100vh; height: 100dvh; overflow: hidden; }
.drive button { font: inherit; }
.drive button:focus-visible, .drive select:focus-visible, .drive a:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.drive svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

/* Type colours: the leaf and the beak, plus a few quiet companions. */
.tint-doc { color: var(--text-soft); background: rgba(230, 221, 200, 0.07); }
.tint-chat { color: var(--leaf); background: rgba(204, 237, 102, 0.08); }
.tint-image { color: #9BD0E4; background: rgba(155, 208, 228, 0.09); }
.tint-pdf { color: #F2A67E; background: rgba(242, 166, 126, 0.09); }
.tint-sheet { color: #A9DB8E; background: rgba(169, 219, 142, 0.09); }
.tint-archive { color: #D8C08A; background: rgba(216, 192, 138, 0.09); }

/* Shell */
.app { display: grid; grid-template-columns: 260px minmax(0, 1fr); height: 100%; }
.app.with-details { grid-template-columns: 260px minmax(0, 1fr) 340px; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

/* Sidebar */
.side { border-right: 1px solid var(--line); background: var(--ground); padding: 22px 16px 20px; display: flex; flex-direction: column; gap: 26px; overflow-y: auto; }
.side .brand { padding: 0 8px; }
.side .brand img { width: 40px; height: 40px; }
.side .brand span { font-size: 22px; letter-spacing: -0.3px; }
.sections { position: relative; display: flex; flex-direction: column; gap: 4px; }
.nav-pill { position: absolute; top: 0; left: 0; right: 0; border-radius: 999px; background: var(--card-hi); pointer-events: none; }
.nav-pill.ready { transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), height 0.3s ease; }
.sections button { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 10px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; text-align: left; cursor: pointer; }
.sections button:hover { color: var(--text); background: var(--card); }
.sections button[aria-current="page"], .sections button[aria-current="page"]:hover { color: var(--leaf); background: transparent; }
.sections .count { margin-left: auto; font-size: 13px; color: var(--faint); }

.meter { margin-top: auto; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.meter-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; }
.meter .tag { font-size: 12px; padding: 2px 10px; }
.meter-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter-bar span { display: block; width: 18.4%; height: 100%; border-radius: inherit; background: var(--leaf); }
.side-contact { margin: 12px 4px 0; font-size: 13px; color: var(--faint); }
.side-contact a { text-decoration: none; }
.meter-text { color: var(--muted); font-size: 14px; }
.meter a { font-size: 14px; font-weight: 700; text-decoration: none; }

/* Top bar */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.menu-btn { display: none; }
.search { flex: 1 1 260px; max-width: 560px; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px; background: var(--card); border: 1px solid var(--line-strong); border-radius: 999px; color: var(--faint); }
.search:focus-within { border-color: var(--text); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; }
.search input::placeholder { color: var(--faint); }
.preview-tag { font-size: 13px; font-weight: 700; color: var(--faint); padding: 4px 12px; border: 1px dashed var(--line-strong); border-radius: 999px; white-space: nowrap; }
.view-toggle { margin: 0 0 0 auto; }
.view-toggle button { display: grid; place-items: center; min-height: 40px; padding: 8px 12px; }
.new { position: relative; }
.new .btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px 10px 14px; cursor: pointer; }
.menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; min-width: 200px; padding: 6px; background: var(--card); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45); }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.menu button:hover, .menu button:focus-visible { background: var(--card-hi); outline: 0; }

/* Content */
.content { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 24px 56px; outline: 0; }
.notice { margin: 0 0 18px; font-size: 14px; color: var(--text-soft); border: 1px dashed var(--line-strong); border-radius: 14px; padding: 10px 14px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.toolbar.sub { margin-top: 12px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-family: var(--display); font-weight: 600; font-size: 26px; line-height: 1.2; min-width: 0; }
.crumbs button { padding: 2px 6px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.crumbs button:hover { color: var(--text); }
.crumbs [aria-current] { padding: 2px 6px; overflow-wrap: anywhere; }
.crumbs svg { width: 18px; height: 18px; color: var(--faint); }
.secure { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--faint); }
.secure svg { width: 15px; height: 15px; }
.summary { font-size: 14px; color: var(--faint); }
.sort { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--faint); }
.sort select { min-height: 36px; padding: 6px 12px; font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; }
.sort .icon-btn { width: 36px; height: 36px; }
#folders-wrap, #files-wrap { margin-top: 26px; }
#folders-wrap .eyebrow, #files-wrap .eyebrow { margin-bottom: 12px; }
.empty { margin: 48px auto 0; max-width: 420px; text-align: center; color: var(--muted); }

/* Folders */
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.folder { display: flex; align-items: center; gap: 14px; min-height: 66px; padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; color: var(--text); text-align: left; cursor: pointer; min-width: 0; }
.folder:hover { border-color: var(--line-strong); }
.folder svg { width: 28px; height: 28px; color: var(--leaf); fill: rgba(204, 237, 102, 0.14); }
.folder > span { min-width: 0; }
.fname { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fmeta { display: block; font-size: 13px; color: var(--faint); }

/* Files: one markup, two views */
.item { position: relative; min-width: 0; }
.item .open { width: 100%; color: var(--text); text-align: left; cursor: pointer; }
.thumb { position: relative; display: grid; place-items: center; }
.act { position: absolute; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 999px; background: rgba(25, 26, 25, 0.72); color: var(--faint); cursor: pointer; }
.act:hover { color: var(--text); }
.act svg { width: 18px; height: 18px; }
.item.starred .star { color: var(--leaf); }
.item.starred .star svg { fill: var(--leaf); }

.files.as-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.files.as-grid .item .open { height: 100%; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 2px 8px; padding: 12px 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; }
.files.as-grid .item .open:hover { border-color: var(--line-strong); }
.files.as-grid .item.selected .open { background: var(--card-hi); border-color: var(--leaf); box-shadow: inset 0 0 0 1px var(--leaf); }
.files.as-grid .thumb { flex: 0 0 100%; height: 100px; margin-bottom: 8px; border-radius: 14px; }
.files.as-grid .thumb svg { width: 38px; height: 38px; stroke-width: 1.5; }
.ext { position: absolute; left: 8px; bottom: 8px; padding: 1px 8px; border-radius: 999px; background: rgba(25, 26, 25, 0.72); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.5px; }
.files.as-grid .name { flex: 0 0 100%; font-weight: 600; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.files.as-grid .kind { display: none; }
.files.as-grid .size, .files.as-grid .date { font-size: 13px; color: var(--faint); }
.files.as-grid .date::before { content: "·"; margin-right: 8px; }
.files.as-grid .act { top: 20px; right: 20px; }

.files.as-list { --cols: 32px minmax(0, 1fr) 170px 90px 120px; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.list-head { display: grid; grid-template-columns: var(--cols); gap: 14px; align-items: center; padding: 6px 56px 6px 14px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--faint); }
.list-head button { display: inline-flex; align-items: center; gap: 4px; padding: 4px 0; border: 0; background: transparent; color: inherit; font-weight: 600; cursor: pointer; }
.list-head button:hover, .list-head button.on { color: var(--text); }
.list-head button svg { width: 14px; height: 14px; }
.list-head .right { justify-content: flex-end; }
.files.as-list .item + .item .open { border-top: 1px solid var(--line); }
.files.as-list .item .open { display: grid; grid-template-columns: var(--cols); gap: 14px; align-items: center; min-height: 54px; padding: 10px 56px 10px 14px; background: transparent; border: 0; }
.files.as-list .item .open:hover { background: rgba(253, 241, 216, 0.03); }
.files.as-list .item.selected .open { background: var(--card-hi); box-shadow: inset 3px 0 0 var(--leaf); }
.files.as-list .thumb { width: 32px; height: 32px; border-radius: 10px; }
.files.as-list .thumb svg { width: 18px; height: 18px; }
.files.as-list .ext { display: none; }
.files.as-list .name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.files.as-list .kind, .files.as-list .size, .files.as-list .date { font-size: 14px; color: var(--muted); white-space: nowrap; }
.files.as-list .size { text-align: right; }
.files.as-list .act { top: 50%; right: 10px; transform: translateY(-50%); background: transparent; }

/* Details */
.details { display: flex; flex-direction: column; gap: 18px; padding: 18px 20px 28px; border-left: 1px solid var(--line); background: var(--ground); overflow-y: auto; }
.d-head { display: flex; align-items: center; justify-content: space-between; }
.d-thumb { display: grid; place-items: center; height: 150px; border-radius: 20px; }
.d-thumb svg { width: 54px; height: 54px; stroke-width: 1.4; }
.details h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 22px; line-height: 1.2; overflow-wrap: anywhere; }
.d-kind { margin-top: 4px; font-size: 14px; color: var(--faint); }
.d-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 18px; margin: 0; font-size: 15px; }
.d-facts dt { color: var(--faint); }
.d-facts dd { margin: 0; color: var(--text-soft); overflow-wrap: anywhere; }
.d-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.d-actions .btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; background: transparent; font-size: 15px; cursor: pointer; }
.d-actions .btn svg { width: 18px; height: 18px; }
.d-actions .btn[aria-pressed="true"] { color: var(--leaf); }
.d-actions .btn[aria-pressed="true"] svg { fill: var(--leaf); }
.versions { list-style: none; margin: 12px 0 0; padding: 0; }
.versions li { position: relative; padding: 0 0 18px 24px; }
.versions li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--ground); }
.versions li::after { content: ""; position: absolute; left: 9px; top: 21px; bottom: 0; width: 2px; background: var(--line); }
.versions li:last-child { padding-bottom: 0; }
.versions li:last-child::after { display: none; }
.versions li.current::before { border-color: var(--leaf); background: var(--leaf); }
.v-title { display: block; font-weight: 600; font-size: 15px; }
.v-meta { display: block; font-size: 13px; color: var(--faint); }

/* Overlays */
.scrim { position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, 0.5); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; display: flex; align-items: center; gap: 16px; max-width: calc(100% - 32px); padding: 12px 14px 12px 20px; background: var(--card-hi); border: 1px solid var(--line-strong); border-radius: 999px; box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45); font-size: 15px; opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: opacity 0.15s ease, transform 0.15s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { padding: 6px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--leaf); font-weight: 700; cursor: pointer; }
.toast button:hover { background: rgba(204, 237, 102, 0.1); }

@media (max-width: 1100px) {
  .app.with-details { grid-template-columns: 260px minmax(0, 1fr); }
  .details { position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(360px, 100%); box-shadow: -16px 0 40px rgba(0, 0, 0, 0.45); }
}

@media (max-width: 760px) {
  .app, .app.with-details { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 50; width: min(290px, 86vw); transform: translateX(-100%); visibility: hidden; transition: transform 0.2s ease, visibility 0s linear 0.2s; }
  .side.open { transform: none; visibility: visible; transition: transform 0.2s ease; }
  .menu-btn { display: inline-grid; width: 44px; height: 44px; }
  .bar { padding: 12px 16px; }
  .search { flex: 1 1 150px; min-width: 0; padding: 0 14px; }
  .view-toggle { order: 11; margin-left: 0; }
  .view-toggle button { padding: 8px 9px; }
  .new .btn { padding: 10px 12px; }
  .new-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .preview-tag { order: 10; flex: 1 1 200px; text-align: center; padding: 9px 12px; }
  .content { padding: 18px 16px 48px; }
  .crumbs { font-size: 22px; }
  .folders { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .files.as-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .list-head { display: none; }
  .files.as-list .item .open { grid-template-columns: 32px auto minmax(0, 1fr); grid-template-rows: auto auto; gap: 0 12px; padding-right: 52px; }
  .files.as-list .thumb { grid-row: 1 / 3; grid-column: 1; }
  .files.as-list .name { grid-row: 1; grid-column: 2 / 4; }
  .files.as-list .kind { display: none; }
  .files.as-list .size { grid-row: 2; grid-column: 2; text-align: left; font-size: 13px; }
  .files.as-list .date { grid-row: 2; grid-column: 3; font-size: 13px; color: var(--faint); }
  .files.as-list .date::before { content: "·"; margin-right: 8px; }
  .details { width: 100%; }
}

/* Motion: quick and quiet. Moving items around is in drive.js. */
@keyframes fade-in { from { opacity: 0; } }
@keyframes details-in { from { opacity: 0; transform: translateX(18px); } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(0.97); } }
@keyframes meter-fill { from { width: 0; } }
@keyframes hop {
  0% { opacity: 0; transform: translateY(8px) rotate(-10deg); }
  55% { opacity: 1; transform: translateY(-4px) rotate(5deg); }
  80% { transform: translateY(1px) rotate(-2deg); }
}

.side .brand img { animation: hop 0.7s cubic-bezier(0.3, 0.7, 0.4, 1) 0.1s backwards; transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
.side .brand:hover img { transform: rotate(-10deg) translateY(-1px); }
.meter-bar span { animation: meter-fill 1s cubic-bezier(0.2, 0.7, 0.3, 1) 0.3s backwards; }
.menu { transform-origin: top right; animation: menu-in 0.14s ease-out; }
.details { animation: details-in 0.24s cubic-bezier(0.2, 0.7, 0.3, 1); }
.scrim, .empty { animation: fade-in 0.2s ease-out; }

.sections button, .toggle button, .icon-btn, .crumbs button, .list-head button, .menu button, .btn { transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.folder, .files.as-grid .item .open { transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease; }
.folder:hover, .files.as-grid .item .open:hover { transform: translateY(-2px); }
.folder:active, .files.as-grid .item .open:active { transform: scale(0.98); }
.folder svg, .files.as-grid .thumb svg { transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1); }
.folder:hover svg { transform: rotate(-6deg) translateY(-1px); }
.files.as-grid .item .open:hover .thumb svg { transform: scale(1.08); }
.files.as-list .item .open { transition: background-color 0.15s ease, box-shadow 0.15s ease; }
.act { transition: color 0.15s ease, transform 0.15s ease; }
.act:hover { transform: scale(1.1); }
.files.as-list .act:hover { transform: translateY(-50%) scale(1.1); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
}
