:root {
  --ink: #252925;
  --muted: #626962;
  --paper: #ffffff;
  --line: #e4e6df;
  --background: #f4f4f0;
  --accent: #303b34;
  --accent-soft: #f3ede3;
  --amber-ink: #835e35;
  --gold: var(--accent);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--background);
}

button, .button {
  column-gap: 5px;
  border-color: #dfe2da;
  color: var(--ink);
  border-radius: 10px;
  background: #fff;
  transition: background-color .16s ease, border-color .16s ease;
}
button:hover, .button:hover { background: #eff1eb; }
.quiet { border-color: transparent; background: transparent; }
.primary { color: white; background: var(--accent); border-color: transparent; }
.primary:hover { background: #202a24; }
.danger { color: #a72c31; }
:focus-visible { outline-color: var(--accent); }

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 68px;
  padding: 10px clamp(14px, 3vw, 38px);
  background: #fffffff2;
  backdrop-filter: blur(14px);
}
.brand-group, .brand { display: flex; align-items: center; gap: 10px; }
.brand { font-size: 18px; letter-spacing: -.025em; }
.brand-symbol, .file-symbol {
  display: grid;
  flex: none;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 11px;
  color: var(--accent);
  background: var(--accent-soft);
}
.brand-symbol { color: #fff; background: var(--accent); }
.drive-icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand-symbol .drive-icon, .file-symbol .drive-icon, .workspace nav .drive-icon { width: 18px; height: 18px; }
#identity { color: var(--muted); font-size: 13px; margin-inline: 4px; }
.settings-link { font-weight: 650; }
.status { background: var(--accent-soft); }

.workspace { grid-template-columns: minmax(188px, 18%) minmax(0, 1fr); }
.workspace nav {
  gap: 6px;
  padding: 26px 14px;
  background: #eeefe9;
  border-right: 1px solid var(--line);
}
.sidebar-label {
  padding: 0 10px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.workspace nav button { gap: 9px; padding: 9px 11px; border-radius: 11px; }
.workspace nav button:hover { background: #e8ebe3; }
.workspace nav [aria-pressed="true"] { color: #303c34; background: #e1e6de; }
.files {
  min-height: calc(100svh - 68px);
  padding: clamp(16px, 4vw, 48px);
  background: var(--background);
}
.files-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(135px, 18vw, 212px) auto;
  grid-template-areas: "copy art actions";
  align-items: center;
  gap: 8px clamp(10px, 2vw, 20px);
  padding: clamp(18px, 3vw, 28px);
  margin-bottom: 18px !important;
  border: 1px solid #e9e5da;
  border-radius: 19px;
  background: linear-gradient(112deg, #fcfcf9 43%, #f5eee3);
}
.files-heading-copy { grid-area: copy; min-width: 0; }
.files-heading-art {
  grid-area: art;
  display: block;
  width: 100%;
  height: auto;
  max-height: 132px;
  object-fit: contain;
  pointer-events: none;
}
.files-heading #write-buttons { grid-area: actions; justify-self: end; align-self: end; }
.files-heading h1, .settings-heading h1 { font-size: clamp(27px, 3.5vw, 38px); letter-spacing: -.055em; line-height: 1.22; }
.files-heading p, .settings-heading p { margin-top: 6px; color: var(--muted); font-size: 13px; }
#folder-back { min-height: 29px; margin: 0 0 4px; padding: 1px 0; color: var(--accent); }
.file-panel { --columns: minmax(0, 1fr) minmax(90px, 19%) 178px; background: #fff; border: 1px solid var(--line); border-radius: 17px; }
.file-panel-header, .file-panel .row {
  display: grid;
  grid-template-columns: var(--columns);
  gap: 8px 14px;
  align-items: center;
  padding-inline: clamp(12px, 2.3vw, 22px);
}
.file-panel-header { min-height: 43px; font-size: 12px; font-weight: 650; color: var(--muted); }
.file-panel-header .action-column { text-align: right; }
#entry-count { margin-left: 5px; font-weight: 400; }
.file-panel .row { min-height: 69px; padding-block: 8px; }
.file-panel .row:hover { background: #fdfdfd; }
.file-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-identity > div { min-width: 0; }
.file-identity strong { font-weight: 650; }
.file-symbol { color: #536358; background: #edf1ec; }
.folder-symbol { color: var(--amber-ink); background: var(--accent-soft); }
.file-actions { justify-content: flex-end; }
.file-actions button, .file-actions .button, .file-more summary { min-height: 34px; padding: 5px 9px; font-size: 12px; }
.file-more { position: relative; }
.file-more summary {
  list-style: none;
  display: grid;
  place-items: center;
  min-width: 34px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 9px;
  white-space: nowrap;
  cursor: pointer;
}
.file-more summary::-webkit-details-marker { display: none; }
.file-more summary:hover, .file-more[open] summary { background: #eff1eb; color: var(--ink); }
.file-menu {
  position: absolute;
  z-index: 3;
  top: calc(100% + 4px);
  right: 0;
  min-width: 112px;
  padding: 5px;
  display: grid;
  gap: 3px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 8px 20px #242a3616;
}
.file-menu button { justify-content: flex-start; border-color: transparent; }
.empty-files { padding: 26px clamp(12px, 2.3vw, 22px); border-top: 1px solid var(--line); }

.settings { max-width: 1130px; }
.settings-heading { margin-bottom: 16px; }
.settings-grid { gap: 14px; }
.panel, .auth, dialog { border-radius: 18px; }
.panel { padding: clamp(14px, 2.6vw, 23px); }
.panel h2 { margin-bottom: 4px; }
#department-form { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
#department-name { width: min(100%, 230px); }
#departments { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
#departments li { min-width: 0; padding: 2px 8px; border: 1px solid var(--line); border-radius: 9px; }
#departments button { min-height: 34px; }
.employee-roster-button[aria-pressed="true"], .issued-password { background: var(--accent-soft); border-color: #e7ddca; }
.auth { box-shadow: 0 14px 36px #22273408; }

@media (max-width: 1090px) {
  .files-heading {
    grid-template-columns: minmax(0, 1fr) minmax(75px, 26%);
    grid-template-areas: "copy art" "actions actions";
  }
  .files-heading #write-buttons { justify-self: start; }
}
@media (max-width: 760px) {
  .top { position: static; gap: 6px; }
  #account-bar button { min-height: 34px; padding: 6px 9px; font-size: 12px; }
  .workspace { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .workspace nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .workspace nav button { justify-content: center; gap: 5px; min-width: 0; padding-inline: 5px; font-size: 13px; }
  .workspace nav .drive-icon { width: 15px; height: 15px; }
  .sidebar-label { display: none; }
  .files { min-height: auto; }
}
@media (max-width: 420px) {
  #identity { display: none; }
  #account-bar .quiet .drive-icon { display: none; }
  .files-heading-art { max-height: 74px; }
}
@media (max-width: 590px) {
  .file-panel { --columns: minmax(0, 1fr) auto; }
  .file-panel .date-column { display: none; }
  .file-actions { gap: 3px; }
  .file-actions button, .file-actions .button, .file-more summary { padding-inline: 7px; }
  .file-actions .file-action .drive-icon { display: none; }
  .file-panel .row { min-height: 61px; gap: 5px; }
  .file-identity { gap: 7px; }
  .file-symbol { width: 29px; height: 29px; }
  .file-symbol .drive-icon { width: 15px; height: 15px; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) {
  .top { row-gap: 5px; }
  #account-bar { gap: 4px; }
  #account-bar button { font-size: 12px; padding-inline: 6px; }
  #identity { font-size: 11px; margin: 0; }
  .files { padding: 11px; }
  .files-heading { padding: 14px; }
  .file-panel-header, .file-panel .row { padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  button, .button { transition: none; }
}
