@font-face { font-family: "IBM Plex Sans"; src: url("/assets/fonts/IBMPlexSans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/assets/fonts/IBMPlexSans-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/assets/fonts/IBMPlexSans-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/assets/fonts/IBMPlexSans-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --purple: #7935d2;
  --purple-dark: #5c11a6;
  --purple-soft: #f1ebfb;
  --purple-line: #d9c8f3;
  --ink: #26232b;
  --muted: #6b6573;
  --line: #e7e3ee;
  --paper: #f8f7fb;
  --white: #fff;
  --error: #c62d27;
  --error-soft: #fdeceb;
  --success: #1f7a5c;
  --success-soft: #e7f5ef;
  --warning: #9a5b00;
  --warning-soft: #fff4e0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(38, 20, 64, .06), 0 12px 40px rgba(38, 20, 64, .08);
  font-family: "IBM Plex Sans", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, -apple-system, system-ui, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: linear-gradient(180deg, #fff 0, var(--paper) 420px); font-size: 16px; line-height: 1.5; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
/* Japanese: break lines between phrases, not mid-word, and drop Latin letter-spacing. */
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3, :lang(ja) .lead { word-break: auto-phrase; letter-spacing: 0; }
:lang(ja) body { line-height: 1.7; }
h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 600; }
h2 { font-size: 20px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
a { color: var(--purple); }
button, input, select, textarea { font: inherit; color: inherit; }
time { white-space: nowrap; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.eyebrow { color: var(--purple); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }
.lead { color: var(--muted); font-size: 18px; margin-top: 12px; }
.lead strong { color: var(--ink); font-weight: 600; }
.hint { color: var(--muted); font-size: 14px; margin-top: 12px; }

/* Layout */
.topbar { height: 72px; padding: 0 clamp(20px, 5vw, 64px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .9); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { display: block; height: 24px; width: auto; }
.brand-product { padding-left: 14px; border-left: 1px solid var(--line); font-weight: 600; color: var(--purple-dark); }
.account { display: flex; align-items: center; gap: 20px; font-size: 15px; }
.account a { text-decoration: none; font-weight: 500; }
.account-name { color: var(--muted); }
.lang-switch { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink) !important; font-size: 14px; font-weight: 500; }
.lang-switch:hover { border-color: var(--purple-line); background: var(--purple-soft); }
.lang-switch svg { color: var(--muted); }
.account form { margin: 0; }
.page { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: clamp(28px, 5vw, 56px) clamp(20px, 5vw, 48px); }
.footer { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 28px; color: var(--muted); font-size: 13px; }

/* Controls */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(22px, 3vw, 32px); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s; white-space: nowrap; }
.button.primary { background: var(--purple); color: #fff; }
.button.primary:hover { background: var(--purple-dark); }
.button.primary.copied { background: var(--success); }
.button.secondary { background: var(--white); border-color: var(--purple-line); color: var(--purple-dark); }
.button.secondary:hover { background: var(--purple-soft); }
.button.danger-ghost { background: none; border-color: var(--line); color: var(--error); margin-top: 24px; }
.button.danger-ghost:hover { background: var(--error-soft); border-color: #f3c3c0; }
.button.full { width: 100%; margin-top: 24px; }
.link-button { background: none; border: 0; padding: 0; color: var(--purple); font-weight: 500; cursor: pointer; text-decoration: none; }
.link-button:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid rgba(121, 53, 210, .35); outline-offset: 2px; }

label { display: block; font-weight: 500; font-size: 15px; margin: 18px 0 6px; }
.optional { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 4px; }
input:not([type="file"]):not([type="hidden"]), select, textarea { width: 100%; padding: 11px 14px; border: 1px solid #d6d1de; border-radius: 10px; background: #fff; font-size: 16px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(121, 53, 210, .15); }
textarea { resize: vertical; min-height: 96px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; align-items: end; }

.alert { background: var(--error-soft); color: var(--error); border-radius: 10px; padding: 12px 14px; margin: 16px 0; font-size: 15px; }
.banner { border-radius: 12px; padding: 14px 18px; margin-bottom: 24px; }
.banner.success { background: var(--success-soft); color: var(--success); }

.status { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; }
.status-open { background: var(--success-soft); color: var(--success); }
.status-expired { background: #efedf2; color: var(--muted); }
.status-closed { background: #efedf2; color: var(--muted); }

.note { white-space: pre-line; margin: 16px 0 0; padding: 14px 18px; border-left: 3px solid var(--purple-line); background: var(--purple-soft); border-radius: 0 10px 10px 0; color: var(--ink); }

/* Sign in */
.signin { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: center; min-height: 60vh; }
.steps { list-style: none; padding: 0; margin: 36px 0 0; counter-reset: step; display: grid; gap: 18px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 36px 1fr; column-gap: 14px; }
.steps li::before { content: counter(step); grid-row: span 2; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--purple-soft); color: var(--purple-dark); font-weight: 600; }
.steps span { color: var(--muted); }
.signin-card { max-width: 420px; justify-self: end; width: 100%; }
.signin-card .muted { margin-top: 6px; }
.slack-button { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 24px; min-height: 50px; border: 1px solid #d6d1de; border-radius: 10px; font-weight: 600; text-decoration: none; color: var(--ink); transition: background .15s, border-color .15s; }
.slack-button:hover { background: var(--paper); border-color: var(--purple-line); }

/* Dashboard */
.page-heading { margin-bottom: 32px; }
.dash-grid { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 32px; align-items: start; }
.new-request { position: sticky; top: 104px; }
.new-request h2 { margin-bottom: 4px; }
.request-list { display: grid; gap: 12px; }
.list-title { font-size: 15px; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
.request-item { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 20px 22px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.request-item:hover { border-color: var(--purple-line); box-shadow: var(--shadow); transform: translateY(-1px); }
.request-main { min-width: 0; }
.request-main h3 { overflow-wrap: anywhere; }
.request-main p { color: var(--muted); margin-top: 2px; }
.request-meta { text-align: right; display: grid; gap: 2px; font-size: 14px; color: var(--muted); flex-shrink: 0; }
.request-meta strong { color: var(--ink); font-size: 15px; font-weight: 600; }
.empty { text-align: center; padding: 56px 24px; border: 1.5px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.empty h2 { color: var(--ink); margin: 14px 0 6px; }
.empty.compact { padding: 32px 20px; margin-top: 16px; }
.empty-icon { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--purple-soft); color: var(--purple); }

/* Request detail */
.back { display: inline-block; margin-bottom: 24px; text-decoration: none; font-weight: 500; }
.detail-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 32px; }
.detail-heading h1 { overflow-wrap: anywhere; }
.detail-grid { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; gap: 24px; align-items: start; }
.share-card h2 { margin-bottom: 16px; }
.share-card h3 { margin-top: 28px; font-size: 14px; color: var(--muted); font-weight: 600; }
.link-box { display: flex; gap: 8px; }
.link-box input { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px !important; background: var(--paper) !important; }
.share-actions { margin-top: 12px; font-size: 15px; }
.files-heading { display: flex; justify-content: space-between; align-items: baseline; }
.received { list-style: none; margin: 16px 0 0; padding: 0; }
.received li { display: grid; grid-template-columns: 48px 1fr; column-gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.received li:first-child { border-top: 0; }
.file-badge { grid-row: span 2; align-self: center; height: 40px; border-radius: 8px; display: grid; place-items: center; background: var(--purple-soft); color: var(--purple-dark); font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.received .file-name { font-weight: 500; overflow-wrap: anywhere; }
.received .file-meta { color: var(--muted); font-size: 14px; }

/* Customer upload */
.upload { display: grid; grid-template-columns: 1fr minmax(340px, 520px); gap: clamp(32px, 6vw, 80px); align-items: start; }
.upload-intro h1 { overflow-wrap: anywhere; }
.assurances { list-style: none; padding: 0; margin: 28px 0 20px; display: grid; gap: 10px; }
.assurances li { display: flex; gap: 10px; }
.assurances span { color: var(--success); font-weight: 700; }
.upload-card { padding: 20px; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 240px; margin: 0; padding: 28px; border: 2px dashed var(--purple-line); border-radius: 12px; background: linear-gradient(180deg, #fff, var(--purple-soft)); text-align: center; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--purple); }
.dropzone.dragging { border-color: var(--purple); background: var(--purple-soft); transform: scale(1.01); }
.dropzone strong { font-size: 20px; font-weight: 600; margin-top: 10px; }
.dropzone-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--purple); color: #fff; box-shadow: 0 8px 24px rgba(121, 53, 210, .3); }
.fake-link { color: var(--purple); font-weight: 500; text-decoration: underline; }
.summary { margin-top: 16px; padding: 14px 16px; border-radius: 10px; background: var(--purple-soft); color: var(--purple-dark); font-size: 15px; }
.summary-success { background: var(--success-soft); color: var(--success); }
.summary-warning { background: var(--warning-soft); color: var(--warning); }
.file-list { list-style: none; margin: 8px 0 0; padding: 0; }
.file-row { padding: 14px 4px; border-bottom: 1px solid var(--line); }
.file-row:last-child { border-bottom: 0; }
.file-row-top { display: flex; align-items: baseline; gap: 10px; }
.file-row .file-name { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .file-size { color: var(--muted); font-size: 14px; flex-shrink: 0; }
.row-action { background: none; border: 0; padding: 0; color: var(--purple); font-size: 14px; font-weight: 500; cursor: pointer; flex-shrink: 0; }
.row-action:hover { text-decoration: underline; }
.progress { height: 6px; margin: 10px 0 6px; border-radius: 3px; background: #ece8f2; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--purple); border-radius: 3px; transition: width .2s ease-out; }
.file-status { font-size: 14px; color: var(--muted); }
.file-row[data-state="done"] .progress span { background: var(--success); }
.file-row[data-state="done"] .file-status { color: var(--success); font-weight: 500; }
.file-row[data-state="failed"] .progress span { background: var(--error); }
.file-row[data-state="failed"] .file-status { color: var(--error); }
.file-row[data-state="cancelled"] { opacity: .6; }
.file-row[data-state="queued"] .progress span { width: 0; }
.touch-only { display: none; }
@media (hover: none) and (pointer: coarse) {
  .pointer-only { display: none; }
  .touch-only { display: inline; }
  .dropzone strong.touch-only { display: block; }
}

.message-card { max-width: 560px; margin: 8vh auto; text-align: center; }
.message-card p { color: var(--muted); margin: 14px 0 0; }
.message-card .button { margin-top: 24px; }

@media (max-width: 860px) {
  .signin, .dash-grid, .detail-grid, .upload { grid-template-columns: 1fr; }
  .signin-card { justify-self: stretch; max-width: none; }
  .new-request { position: static; }
  .detail-heading { flex-direction: column; align-items: flex-start; }
  .account-name { display: none; }
  .dropzone { min-height: 180px; }

  /* Phones: the drop zone right after the heading and note, reassurance below it. */
  .upload { gap: 24px; }
  .upload-intro { display: contents; }
  .upload-intro > * { order: 1; margin-top: 0; margin-bottom: 0; }
  .upload-intro > .eyebrow, .upload-intro > h1, .upload-intro > .lead, .upload-intro > .note { order: 0; }
  .upload-card { order: 0; }
  .upload-intro > .eyebrow { margin-bottom: -14px; }
}

@media (max-width: 520px) {
  .brand img { height: 20px; }
  .brand-product { font-size: 14px; }
  .request-item { flex-direction: column; align-items: flex-start; }
  .request-meta { text-align: left; }
  .link-box { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
