:root { color-scheme: light; --ink: #17382f; --muted: #50695e; --green: #165b46; --line: #dce6df; }
* { box-sizing: border-box; }
body { margin: 0; background: #f5f7f3; color: var(--ink); font: 16px/1.55 system-ui, sans-serif; }
a { color: var(--green); text-underline-offset: .2em; }
header { background: white; border-bottom: 1px solid var(--line); }
header div, main { width: min(100% - 2rem, 1050px); margin: auto; }
header div { display: flex; justify-content: space-between; gap: .75rem; padding: 1.25rem 0; }
header a { font-weight: 750; text-decoration: none; }
header span, small { color: var(--muted); }
main { padding: clamp(1.5rem, 5vw, 4rem) 0; }
h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.18; letter-spacing: -.035em; }
p { margin: .65rem 0 0; color: var(--muted); }
.panel { background: white; border: 1px solid var(--line); border-radius: 18px; padding: clamp(1rem, 4vw, 2rem); }
.login { max-width: 480px; margin: 0 auto; }
.stack { display: grid; gap: .8rem; margin: 1.2rem 0; }
label { display: grid; gap: .25rem; font-size: .9rem; font-weight: 650; }
input { width: 100%; min-width: 0; color: var(--ink); font: inherit; border: 1px solid #bdcfc5; border-radius: 8px; padding: .55rem .7rem; background: white; }
button, summary { color: white; background: var(--green); border: 1px solid var(--green); border-radius: 8px; padding: .55rem .85rem; font: inherit; font-weight: 650; cursor: pointer; }
summary, .secondary { color: var(--green); background: white; border-color: var(--line); }
:focus-visible { outline: 3px solid #9a6717; outline-offset: 3px; }
.heading, .entry, .actions, .toolbar, .crumbs { display: flex; gap: .65rem 1rem; }
.heading, .entry { justify-content: space-between; align-items: start; }
.kicker { margin: 0 0 .35rem; font-weight: 700; color: var(--green); }
.crumbs { flex-wrap: wrap; margin: 1.3rem 0; padding: .65rem 0; overflow-wrap: anywhere; }
.crumbs span { color: var(--muted); }
.toolbar { flex-wrap: wrap; margin: 0 0 1rem; }
.toolbar details, .actions details { min-width: 0; max-width: 100%; }
.actions { justify-content: end; align-items: start; flex-wrap: wrap; }
.actions a { padding: .45rem 0; }
.entries { padding-top: .25rem; padding-bottom: .25rem; }
.entries > p { padding-bottom: .65rem; }
.entry { padding: .85rem 0; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: 0; }
.filename { min-width: 0; overflow-wrap: anywhere; }
.filename small { display: block; }
.filename a { font-weight: 650; }
.alert, .notice { padding: .7rem .9rem; margin: .9rem 0; border-radius: 8px; }
.alert { background: #fff1e8; color: #723919; }
.notice { background: #e7f3e9; color: var(--ink); }
.replace { padding-top: .8rem; border-top: 1px solid var(--line); }
@media (max-width: 560px) {
  .entry { flex-direction: column; }
  .actions { justify-content: start; }
}

.workspace main { width: min(100% - 3rem, 1440px); padding: 1.4rem 0 3rem; }
.app-header > div { width: min(100% - 3rem, 1440px); align-items: center; }
.app-header a { display: inline-flex; align-items: center; gap: .7rem; }
.app-mark, .nav-icon { display: inline-grid; flex: none; place-items: center; width: 2.35rem; height: 2.35rem; border-radius: .7rem; background: #dceee5; color: #155744; font-weight: 800; }
.drive-shell { display: grid; grid-template-columns: 205px minmax(0, 1fr); gap: 1rem; }
.drive-nav { display: flex; flex-direction: column; align-self: start; gap: .5rem; background: #eaf0e9; padding: 1rem; border-radius: 16px; }
.nav-identity { display: flex; align-items: center; gap: .65rem; padding: .25rem 0 .8rem; }
.nav-identity > div { min-width: 0; overflow-wrap: anywhere; }
.nav-identity small, .nav-bottom small { display: block; }
.nav-home, .nav-link { display: flex; align-items: center; gap: .6rem; border-radius: 8px; padding: .55rem .6rem; font-size: .92rem; text-decoration: none; }
.nav-home[aria-current], .nav-home:hover, .nav-link:hover { background: #d8e8df; }
.nav-bottom { margin-top: .9rem; padding: .8rem .15rem 0; border-top: 1px solid #cddbd0; }
.nav-bottom form { margin-top: .6rem; }
.drive-content { min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: white; padding: clamp(.9rem, 2.3vw, 1.7rem); }
.drive-search { display: flex; align-items: stretch; gap: .5rem; max-width: 570px; }
.drive-search-field { display: flex; position: relative; align-items: center; flex: 1 1 auto; min-width: 0; }
.drive-search input { padding-left: 2.4rem; background: #f4f7f3; }
.search-icon { position: absolute; top: calc(50% - .44rem); left: .9rem; width: .75rem; height: .75rem; border: 2px solid var(--muted); border-radius: 50%; }
.search-icon::after { content: ''; position: absolute; width: .38rem; height: 2px; background: var(--muted); transform: rotate(45deg); top: .57rem; left: .48rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.drive-content .crumbs { margin: .95rem 0 .15rem; padding: .15rem 0; font-size: .87rem; }
.drive-title { display: flex; justify-content: space-between; align-items: end; gap: .75rem; flex-wrap: wrap; margin-bottom: .9rem; }
.drive-title h1 { font-size: clamp(1.65rem, 3vw, 2.35rem); overflow-wrap: anywhere; }
.drive-title p { margin: .25rem 0 0; font-size: .88rem; }
.layout-picker { display: flex; padding: .2rem; border-radius: 10px; background: #eef3ee; gap: .15rem; }
.layout-picker a { padding: .32rem .65rem; border-radius: 7px; font-size: .88rem; font-weight: 650; text-decoration: none; }
.layout-picker a[aria-current] { background: white; box-shadow: 0 1px 3px #193c2826; }
.drive-tools { display: flex; flex-wrap: wrap; gap: .55rem; align-items: flex-start; margin-bottom: .85rem; }
.drive-tools details:first-child > summary { color: white; background: var(--green); }
.drive-tools summary, .file-actions summary { padding: .4rem .65rem; font-size: .88rem; }
.drive-tools .stack, .file-actions .stack { margin: .65rem 0 0; }
.clear-search { padding: .38rem; }
.drive-body { display: grid; gap: .85rem; }
.drive-body.has-preview { grid-template-columns: minmax(0, 1fr) minmax(240px, .92fr); align-items: start; }
.file-list { border: 1px solid var(--line); border-radius: 13px; min-width: 0; overflow: hidden; }
.list-head, .drive-file { display: grid; grid-template-columns: minmax(110px, 1fr) 65px minmax(120px, auto); gap: .65rem; align-items: start; padding: .65rem .8rem; }
.list-head { background: #f0f5f1; font-weight: 700; font-size: .8rem; color: var(--muted); }
.drive-file + .drive-file { border-top: 1px solid #edf1ed; }
.drive-file:hover, .selected-file { background: #edf6ef; }
.file-name { min-width: 0; display: flex; align-items: center; gap: .6rem; text-decoration: none; font-size: .92rem; }
.file-name:hover strong { text-decoration: underline; }
.file-label { min-width: 0; overflow-wrap: anywhere; }
.file-label small { display: block; font-size: .72rem; }
.file-icon { display: inline-block; flex: 0 0 auto; position: relative; width: 1.4rem; height: 1.1rem; border-radius: .18rem; }
.folder-icon { background: #4a8166; }
.folder-icon::before { content: ''; position: absolute; width: .6rem; height: .3rem; top: -.19rem; left: 0; border-radius: .16rem .12rem 0 0; background: #4a8166; }
.document-icon { background: #deeee5; width: 1.13rem; height: 1.4rem; box-shadow: inset 0 0 0 1px #6f9b85; }
.document-icon::after { position: absolute; content: ''; width: .55rem; height: .35rem; top: .4rem; left: .3rem; border-block: 1px solid #5c886f; }
.file-size { padding-top: .12rem; font-size: .8rem; color: var(--muted); }
.file-actions { display: flex; gap: .4rem .58rem; flex-wrap: wrap; align-items: flex-start; font-size: .79rem; }
.file-actions a { padding-block: .24rem; }
.file-actions details[open] { flex: 1 1 100%; max-width: 250px; }
.file-actions summary { padding: .15rem .35rem; font-size: .78rem; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: .65rem; border: 0; }
.file-grid .drive-file { display: flex; flex-direction: column; gap: .6rem; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.file-grid .file-name { width: 100%; align-items: flex-start; }
.file-grid .file-size { display: none; }
.drive-empty { grid-column: 1 / -1; text-align: center; padding: 2.7rem .8rem; background: #fafcf9; border-radius: 10px; }
.drive-empty h2 { margin: .6rem 0 0; font-size: 1.12rem; }
.quick-preview { min-width: 0; border: 1px solid #bcd2c5; background: #f9fbf8; border-radius: 13px; overflow: hidden; }
.preview-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; border-bottom: 1px solid var(--line); padding: .65rem .85rem; background: #ebf4ed; }
.preview-top h2 { font-size: 1rem; margin: 0; }
.preview-close { text-decoration: none; text-align: center; border-radius: 50%; font-size: 1.3rem; line-height: 1.45; min-width: 2rem; }
.preview-close:hover { background: #d7e9de; }
.preview-name { padding: .62rem .8rem; margin: 0; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.preview-media { border-block: 1px solid var(--line); background: white; min-height: 145px; }
.preview-media iframe { display: block; width: 100%; height: clamp(320px, 54vh, 650px); border: 0; }
.preview-media img { display: block; margin: auto; max-width: 100%; max-height: 65vh; object-fit: contain; }
.preview-media pre { font-size: .84rem; white-space: pre-wrap; overflow-wrap: anywhere; padding: .8rem; margin: 0; max-height: 52vh; overflow: auto; }
.preview-media > p { padding: .6rem .8rem; font-size: .82rem; }
.preview-not-available { padding: 1.2rem .8rem; text-align: center; }
.preview-actions { display: flex; flex-wrap: wrap; gap: .45rem; padding: .75rem; }
.preview-actions a { border: 1px solid var(--line); border-radius: 8px; padding: .36rem .55rem; font-size: .82rem; }
@media (max-width: 1050px) {
  .drive-body.has-preview .list-head, .drive-body.has-preview .drive-file { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
  .drive-body.has-preview .list-head span:not(:first-child), .drive-body.has-preview .file-size { display: none; }
}
@media (max-width: 760px) {
  .workspace, .app-header > div { width: calc(100% - 1rem); }
  .drive-shell { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .drive-nav { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; padding: .6rem; }
  .nav-identity { padding: 0; margin-right: auto; }
  .nav-bottom { display: flex; align-items: center; gap: .45rem; border: 0; padding: 0; margin: 0; }
  .nav-bottom form { margin: 0; }
  .drive-body.has-preview { display: flex; flex-direction: column-reverse; }
  .file-list, .quick-preview { width: 100%; }
}
@media (max-width: 490px) {
  .list-head, .drive-file { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
  .list-head span:not(:first-child), .file-size { display: none; }
}

.app-mark::before { content: ''; width: 1.05rem; height: .78rem; background: var(--green); border-radius: .16rem; box-shadow: -.14rem -.25rem 0 -.16rem var(--green); }

.account-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.account-tools > form, .account-row form { padding: 1rem; border-radius: 12px; background: #f3f7f4; }
.account-tools h2 { margin: 0; }
.account-row { margin-top: .55rem; }
.account-row[open] { border: 1px solid var(--line); border-radius: 8px; padding: .45rem; }
.account-row p { padding: .35rem; }
.panel select { font: inherit; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 8px; padding: .6rem .7rem; }
@media (max-width: 650px) {
    .account-tools { grid-template-columns: minmax(0, 1fr); }
}
