/* ZRM palette (internal-brand 0.2.0). Orange fill takes a navy label, never white.
   Orange-coloured text on white uses orange-700. Internal tool: system font stack. */
:root {
  color-scheme: light dark;
  --orange-300: #ffa44d;
  --orange-500: #ff7800;
  --orange-600: #d86000;
  --orange-700: #a74a00;
  --navy-50: #eef1f4;
  --navy-100: #d6dde3;
  --navy-200: #a9b6c2;
  --navy-400: #4f657a;
  --navy-500: #2a3e53;
  --navy-700: #121e2d;
  --navy-800: #0d1a27;

  --bg: #ffffff;
  --card: #ffffff;
  --border: var(--navy-100);
  --text: var(--navy-800);
  --muted: var(--navy-400);
  --link: var(--orange-700);
  --focus: var(--navy-800);
  --error: #9b1c1c;
  --warning-bg: #fff5eb;
  --warning-border: var(--orange-500);
  --field: #ffffff;
  --field-border: var(--navy-400);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--navy-800);
    --card: var(--navy-700);
    --border: var(--navy-500);
    --text: var(--navy-50);
    --muted: var(--navy-200);
    --link: var(--orange-300);
    --focus: var(--orange-300);
    --error: #ff9a9a;
    --warning-bg: #1c2c3d;
    --field: var(--navy-800);
    --field-border: var(--navy-200);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

h1, h2 { line-height: 1.2; font-weight: 700; margin: 0 0 .75rem; }
h1 { font-size: 1.75rem; margin-bottom: 1.25rem; }
h2 { font-size: 1.2rem; }
p { margin: 0 0 .75rem; }
a { color: var(--link); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

/* header */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .75rem 1rem; border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .75rem; }
.product { font-weight: 700; }

/* The logo file is an A4 artboard with a lot of empty margin, so it is shown
   through a window cut to the artwork. The file itself is untouched. */
/* Artwork box measured in the SVG: x 138.02, y 196.44, 601.37 wide, 175.84 high, on an 841.89 by 595.28 artboard. */
.logo { position: relative; display: block; width: 6rem; height: 1.75rem; overflow: hidden; }
.logo img { position: absolute; width: 140%; max-width: none; left: -22.95%; top: -111.7%; height: auto; }
.logo-for-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .logo-for-light { display: none; }
  .logo-for-dark { display: block; }
}

.account { display: flex; align-items: center; gap: .75rem; font-size: .95rem; color: var(--muted); }

main { max-width: 52rem; margin: 0 auto; padding: 2rem 1rem 4rem; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: .6rem;
  padding: 1.25rem; margin-bottom: 1.5rem;
}

/* form */
.field { margin-bottom: 1.1rem; }
label { display: block; font-weight: 700; margin-bottom: .3rem; }
input[type=text], input[type=search], input[type=file] {
  display: block; width: 100%; padding: .6rem .7rem; font: inherit; color: var(--text);
  background: var(--field); border: 1px solid var(--field-border); border-radius: .4rem;
}
input[type=file] { padding: .5rem; }
.hint { color: var(--muted); font-size: .9rem; margin: .35rem 0 0; }
.error-text { color: var(--error); }
.status { min-height: 1.5rem; margin: .75rem 0 0; }

.notice { padding: .75rem 1rem; border-radius: .4rem; border: 1px solid var(--border); }
.notice.warning { background: var(--warning-bg); border-left: 4px solid var(--warning-border); }
.notice.error { color: var(--error); border-color: var(--error); font-weight: 700; }

progress { display: block; width: 100%; height: .6rem; margin: 0 0 1rem; accent-color: var(--orange-500); }

/* buttons */
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }
button, .button {
  display: inline-block; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  padding: .6rem 1.1rem; border-radius: .4rem; border: 2px solid var(--text);
  background: transparent; color: var(--text); min-height: 2.75rem;
}
button.primary, .button.primary { background: var(--orange-500); border-color: var(--orange-500); color: var(--navy-800); }
button.primary:hover:not(:disabled), .button.primary:hover { background: var(--orange-600); border-color: var(--orange-600); }
button.secondary:hover:not(:disabled) { background: var(--border); }
button.danger { border-color: var(--error); color: var(--error); }
button.danger:hover:not(:disabled) { background: var(--error); color: var(--bg); }
button.quiet { border: 0; padding: .25rem .5rem; min-height: 0; color: var(--link); text-decoration: underline; background: transparent; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* list */
.folders { list-style: none; margin: 0; padding: 0; }
.folder {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .9rem 0; border-top: 1px solid var(--border);
}
.folder:first-child { border-top: 0; }
.folder-main { display: flex; flex-direction: column; min-width: 0; }
.folder-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.folder-name { font-weight: 700; overflow-wrap: anywhere; }
.folder .status { margin: .25rem 0 0; min-height: 0; font-size: .9rem; }

dialog {
  max-width: 28rem; width: calc(100% - 2rem); border: 1px solid var(--border); border-radius: .6rem;
  background: var(--card); color: var(--text); padding: 1.25rem;
}
dialog::backdrop { background: rgb(13 26 39 / .6); }

@media (max-width: 30rem) {
  .actions button, .actions .button { width: 100%; text-align: center; }
  .folder-actions, .folder button { width: 100%; }
}

/* ---------- sign-in screen: login panel on the right, a preview of the result on the left ---------- */
body.signed-out .topbar, body.signed-out main { display: none; }

.login {
  --stage: #eef3f7;
  --win-bar: var(--navy-50);
  --win-url: #ffffff;
  --ph-strong: var(--navy-200);
  --ph-soft: var(--navy-100);
  --tile: var(--navy-50);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(21rem, 27.5rem); grid-template-areas: "stage panel";
  min-height: 100vh;
}
@media (prefers-color-scheme: dark) {
  .login {
    --stage: var(--navy-800);
    --win-bar: #1c2c3d;
    --win-url: var(--navy-800);
    --ph-strong: var(--navy-400);
    --ph-soft: var(--navy-500);
    --tile: #1c2c3d;
  }
}

.login-panel {
  grid-area: panel; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  padding: 2.5rem; background: var(--card); border-left: 1px solid var(--border);
}
.login-main h1 { font-size: 2rem; letter-spacing: -.02em; }
.login-main .lead { margin: 0 0 1.75rem; color: var(--muted); }
.login-main .notice { margin-bottom: 1.25rem; }
.login-main .hint { margin-top: 1.5rem; }
.login-product { margin: 0; color: var(--muted); font-size: .9rem; }

.providers { display: grid; gap: .75rem; }
.button.provider {
  display: flex; align-items: center; gap: .75rem; width: 100%; text-align: left;
  background: var(--field); border: 1.5px solid var(--field-border); border-radius: .5rem;
  transition: border-color .15s, background .15s;
}
.button.provider:hover { border-color: var(--link); }
.button.provider::after {
  content: "\2192"; content: "\2192" / ""; margin-left: auto; color: var(--muted);
  transition: transform .15s, color .15s;
}
.button.provider:hover::after { transform: translateX(3px); color: var(--link); }
.ico { width: 1.25rem; height: 1.25rem; flex: none; background: center / contain no-repeat; }
.ico-google { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23EA4335' d='M24 9.5c3.5 0 6.6 1.2 9.1 3.6l6.8-6.8C35.9 2.4 30.4 0 24 0 14.6 0 6.5 5.4 2.6 13.2l7.9 6.1C12.4 13.6 17.7 9.5 24 9.5z'/%3E%3Cpath fill='%234285F4' d='M46.5 24.5c0-1.6-.1-3.1-.4-4.5H24v9h12.7c-.6 3-2.3 5.5-4.8 7.2l7.5 5.8c4.4-4.1 7.1-10.1 7.1-17.5z'/%3E%3Cpath fill='%23FBBC05' d='M10.5 28.7a14.5 14.5 0 0 1 0-9.4l-7.9-6.1a24 24 0 0 0 0 21.6l7.9-6.1z'/%3E%3Cpath fill='%2334A853' d='M24 48c6.5 0 11.9-2.1 15.9-5.8l-7.5-5.8c-2.1 1.4-4.9 2.3-8.4 2.3-6.3 0-11.6-4.1-13.5-9.8l-7.9 6.1C6.5 42.6 14.6 48 24 48z'/%3E%3C/svg%3E"); }
.ico-zoho { width: 1.9rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 40'%3E%3Cg fill='none' stroke-width='4' stroke-linejoin='round'%3E%3Crect x='3' y='8' width='11' height='24' rx='3' stroke='%23E42527'/%3E%3Crect x='17' y='8' width='11' height='24' rx='3' stroke='%23089949'/%3E%3Crect x='31' y='8' width='11' height='24' rx='3' stroke='%232F6FB5'/%3E%3Crect x='45' y='8' width='11' height='24' rx='3' stroke='%23F7B500'/%3E%3C/g%3E%3C/svg%3E"); }

.login-stage {
  grid-area: stage; position: relative; display: grid; place-items: center; padding: 2rem; overflow: hidden;
  background: var(--stage);
}
.big-dot {
  position: absolute; right: -8%; bottom: -14%; width: 38vw; max-width: 32rem; aspect-ratio: 1;
  border-radius: 50%; background: var(--orange-500); opacity: .1;
}
.window {
  position: relative; width: min(100%, 40rem); background: var(--card); border: 1px solid var(--border);
  border-radius: .9rem; box-shadow: 0 30px 90px rgb(13 26 39 / .25); overflow: hidden;
}
.window-bar { display: flex; align-items: center; gap: .45rem; padding: .75rem 1rem; background: var(--win-bar); border-bottom: 1px solid var(--border); }
.window-bar > i { width: .65rem; height: .65rem; border-radius: 50%; background: var(--ph-strong); }
.window-url {
  flex: 1; margin-left: .75rem; padding: .55rem .75rem; border-radius: .45rem; background: var(--win-url);
  font: .9rem/1 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--text); white-space: nowrap; overflow: hidden;
}
.window-url .host { color: var(--muted); }
.window-url .slug {
  display: inline-block; width: 0; overflow: hidden; vertical-align: bottom; white-space: nowrap;
  color: var(--link); border-right: 2px solid var(--link);
  animation: type 6s steps(9) infinite, caret .8s step-end infinite;
}
@keyframes type { 0% { width: 0; } 35%, 90% { width: 9ch; } 100% { width: 0; } }
@keyframes caret { 50% { border-color: transparent; } }

.window-view { display: grid; gap: 1rem; align-content: start; min-height: 17.5rem; padding: 1.75rem; }
.window-view .bar-h { height: 1.1rem; width: 45%; border-radius: .4rem; background: var(--ph-strong); }
.window-view .bar-l { height: .65rem; border-radius: .35rem; background: var(--ph-soft); }
.window-view .bar-l:nth-child(3) { width: 90%; }
.window-view .bar-l:nth-child(4) { width: 70%; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-top: .5rem; }
.tiles i { height: 5rem; border-radius: .6rem; background: var(--tile); border: 1px solid var(--border); }
.tiles i:nth-child(2) { background: rgb(255 120 0 / .16); border-color: rgb(255 120 0 / .45); }

.chip {
  position: absolute; left: 1.5rem; bottom: 1.5rem; display: flex; align-items: center; gap: .6rem;
  padding: .6rem .9rem; border-radius: .6rem; background: var(--orange-500); color: var(--navy-800);
  font-weight: 700; font-size: .9rem; box-shadow: 0 10px 30px rgb(255 120 0 / .3); animation: bob 3s ease-in-out infinite;
}
.chip small { font: 500 .8rem ui-monospace, 'SF Mono', Menlo, Consolas, monospace; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.caption { position: absolute; left: 2.5rem; bottom: 2rem; margin: 0; color: var(--muted); font-size: .9rem; }

@media (max-width: 56rem) {
  .login { grid-template-columns: 1fr; grid-template-areas: "panel" "stage"; }
  .login-panel { border-left: 0; border-bottom: 1px solid var(--border); }
  .login-stage { padding: 2rem 1rem 3rem; }
  .caption { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .window-url .slug { animation: none; width: auto; border-right: 0; }
  .chip { animation: none; }
  .button.provider, .button.provider::after { transition: none; }
}
