:root {
  --paper: #f3efe6;
  --ink: #111111;
  --muted: #6f6b63;
  --line: #b8b2a7;
  --soft: #e8e2d7;
  --white: #fffdf8;
  --danger: #111111;
  --radius: 24px;
  --shadow: 0 18px 50px rgba(17,17,17,.08);
}

* { box-sizing: border-box; }
button:focus { outline: none; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); color: var(--ink); }
body { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; }
button, input { font: inherit; }
button { color: inherit; }

.app-shell {
  width: 100%;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.screen {
  width: min(100%, 440px);
  height: 100dvh;
  background: var(--white);
  border-left: 1.5px solid var(--ink);
  border-right: 1.5px solid var(--ink);
  overflow: hidden;
  overscroll-behavior: none;
  display: flex;
  flex-direction: column;
  position: relative;
}

.topbar {
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
}

.brand { font-size: 10px; letter-spacing: .14em; }
.timer { min-width: 58px; text-align: right; font-variant-numeric: tabular-nums; }
.progress-track { height: 4px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; width: 100%; background: var(--ink); transform-origin: left center; }

.mission-copy { padding: 26px 22px 18px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.mission-copy h1 { margin: 0 0 10px; font-size: 30px; line-height: .98; letter-spacing: -.035em; }
.mission-copy blockquote { margin: 0; font-size: 20px; font-weight: 750; line-height: 1.15; }
.instruction { margin: 12px 0 0; font-size: 14px; color: var(--muted); }

.workspace { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li { border-bottom: 1px solid var(--soft); }
.file-button {
  width: 100%; border: 0; background: transparent; padding: 14px 18px;
  display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
}
.file-button:hover { background: var(--soft); }
.file-button.selected { background: var(--ink); color: var(--white); }
.icon { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 24px; }
.filename { flex: 1; font-size: 15px; }
.meta { color: var(--muted); font-size: 11px; }

.grid-files { padding: 20px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.grid-item { border: 0; background: transparent; cursor: pointer; padding: 10px; border-radius: 14px; text-align: center; }
.grid-item:hover { background: var(--soft); }
.folder-shape { width: 66px; height: 46px; margin: 0 auto 10px; border-radius: 7px; background: #8b877f; position: relative; }
.folder-shape::before { content: ""; position: absolute; width: 28px; height: 9px; top: -7px; left: 3px; background: #8b877f; border-radius: 5px 5px 0 0; }

.whatsapp { background: #f8f4ec; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--white); display: grid; place-items: center; font-size: 12px; }
.chat-list { padding: 10px 14px 18px; display: grid; gap: 8px; }
.chat-file { border: 1px solid var(--line); background: var(--white); padding: 11px 12px; border-radius: 12px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.chat-file:hover { background: var(--soft); }
.chat-time { margin-left: auto; font-size: 10px; color: var(--muted); }

.search-panel { padding: 26px 20px; text-align: center; display: grid; gap: 22px; }
.search-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: left; background: var(--paper); }
.big-number { font-size: 54px; font-weight: 900; letter-spacing: -.05em; }

.desktop { flex: 1; background: #252525; color: white; padding: 18px; display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; align-content: start; }
.desktop button { color: white; }
.desktop-file { border: 1px solid transparent; background: transparent; padding: 8px 4px; border-radius: 8px; font-size: 10px; cursor: pointer; overflow-wrap: anywhere; }
.desktop-file:hover { border-color: #777; background: rgba(255,255,255,.08); }

.zip-stage { flex: 1; display: grid; place-items: center; padding: 28px; text-align: center; }
.zip-card { border: 1px solid var(--line); border-radius: 18px; padding: 28px; width: 100%; background: var(--paper); cursor: pointer; }
.zip-icon { font-size: 54px; margin-bottom: 12px; }

.footer-action { border-top: 1px solid var(--line); padding: 14px 18px; text-align: center; text-transform: uppercase; font-size: 11px; font-weight: 800; letter-spacing: .04em; }

.home { padding: 26px; justify-content: space-between; }
.home-hero { flex: 1; display: flex; flex-direction: column; padding: 24px 24px 0; }
.home-center { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.hero-title { margin: 0; font-size: clamp(44px, 13vw, 72px); line-height: .88; letter-spacing: -.05em; text-transform: uppercase; font-weight: 950; text-align: center; }
.folder-mark { width: 64px; height: 46px; background: var(--ink); border-radius: 6px; margin: 40px auto 0; position: relative; }
.folder-mark::before { content: ""; position: absolute; width: 28px; height: 10px; left: 4px; top: -8px; background: var(--ink); border-radius: 5px 5px 0 0; }
.home-copy { text-align: center; }
.home-copy strong { display: block; font-size: 13px; text-transform: uppercase; margin-bottom: 28px; }
.home-copy p { margin: 0 0 30px; font-size: 14px; }
.primary { width: 100%; border: 0; background: var(--ink); color: white; border-radius: 8px; padding: 18px; font-weight: 850; text-transform: uppercase; cursor: pointer; }
.primary:hover { opacity: .86; }

.feedback { position: absolute; inset: 0; background: rgba(17,17,17,.96); color: white; display: grid; place-items: center; padding: 26px; text-align: center; z-index: 20; }
.feedback h2 { font-size: 46px; margin: 0 0 12px; line-height: .9; }
.feedback p { margin: 0; color: #d7d7d7; font-size: 17px; }

.final-screen { background: var(--ink); color: white; border-color: var(--ink); padding: 26px; justify-content: center; text-align: center; }
.final-screen h1 { font-size: 54px; line-height: .9; margin: 0 0 16px; text-transform: uppercase; }
.stats { margin: 34px 0; display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; border-top: 1px solid #555; border-bottom: 1px solid #555; padding: 22px 0; }
.stat strong { display: block; font-size: 30px; }
.stat span { font-size: 10px; text-transform: uppercase; color: #bbb; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.secondary { border: 1px solid #aaa; background: transparent; color: white; padding: 14px; border-radius: 8px; cursor: pointer; }
.studio-link { display: block; margin-top: 28px; color: #aaa; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; text-decoration: none; font-weight: 700; }
.studio-link:hover { color: white; }

@media (max-width: 520px) {
  .screen {
    width: 100%;
    border: 0;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .topbar { padding: 14px 16px 10px; }
  .mission-copy { padding: 18px 18px 14px; }
  .mission-copy h1 { font-size: clamp(26px, 8vw, 34px); }
  .mission-copy blockquote { font-size: clamp(17px, 5.2vw, 21px); }
  .instruction { font-size: 13px; }
  .workspace { overflow: auto; -webkit-overflow-scrolling: touch; }
  .file-button { min-height: 52px; padding: 12px 16px; }
  .chat-file { min-height: 50px; }
  .grid-item, .desktop-file, .zip-card, .primary, .secondary { touch-action: manipulation; }
  .footer-action { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .home { padding: calc(22px + env(safe-area-inset-top)) 22px calc(22px + env(safe-area-inset-bottom)); }
  .home .brand { margin-bottom: 42px; }
  .folder-mark { margin-top: 34px; }
  .hero-title { font-size: clamp(44px, 14vw, 68px); }
}

@media (max-height: 700px) and (max-width: 520px) {
  .mission-copy { padding-top: 12px; padding-bottom: 10px; }
  .mission-copy h1 { margin-bottom: 6px; }
  .instruction { margin-top: 8px; }
  .file-button { min-height: 46px; padding-top: 9px; padding-bottom: 9px; }
  .footer-action { padding-top: 9px; }
}
