/* Ocean Desk — deep-water palette, quiet enough to work in all day. */

:root {
  --ink:      #0d1b2a;
  --deep:     #12293f;
  --sea:      #1b4965;
  --tide:     #2c7da0;
  --foam:     #a9d6e5;
  --paper:    #f7fafc;
  --card:     #ffffff;
  --line:     #dbe6ee;
  --muted:    #6b8299;
  --urgent:   #c1121f;
  --done:     #2a9d8f;
  --shadow:   0 1px 3px rgba(13,27,42,.09), 0 8px 24px rgba(13,27,42,.05);
  --radius:   10px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; }

/* ------------------------------------------------------------------ gate */
.gate {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--ink), var(--sea) 60%, var(--tide));
}
.gate-card {
  background: var(--card); padding: 40px 38px; border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3); width: min(360px, 90vw); text-align: center;
}
.mark { font-size: 40px; line-height: 1; }
.mark.small { font-size: 22px; }
.gate-card h1 { margin: 10px 0 4px; font-size: 24px; letter-spacing: -.02em; }
.gate-card .sub { margin: 0 0 22px; color: var(--muted); font-size: 13.5px; }
.gate-card input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 8px; margin-bottom: 10px; outline: none;
}
.gate-card input:focus { border-color: var(--tide); box-shadow: 0 0 0 3px rgba(44,125,160,.15); }
.gate-card button {
  width: 100%; padding: 11px; border: 0; border-radius: 8px;
  background: var(--sea); color: #fff; font-weight: 600;
}
.gate-card button:hover { background: var(--tide); }
.gate-error { color: var(--urgent); font-size: 13px; min-height: 18px; margin: 10px 0 0; }
.pick-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); margin: 0 0 10px;
}
.picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick {
  padding: 14px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); color: var(--ink); font-weight: 600; font-size: 15px; transition: .15s;
}
.pick:hover { background: var(--sea); color: #fff; border-color: var(--sea); transform: translateY(-1px); }

/* ------------------------------------------------------------------- app */
.app { display: grid; grid-template-columns: 250px 1fr; height: 100vh; }

.rail {
  background: var(--ink); color: #dce7f0; padding: 18px 14px;
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
}
.rail-head { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; }
.rail-title { font-weight: 700; letter-spacing: -.01em; }
.rail-who { font-size: 12px; color: var(--foam); }
.rail-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: #7d97ad; margin: 6px 4px;
}
.projects { display: flex; flex-direction: column; gap: 2px; }
.proj {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: transparent; border: 0; color: #cfe0ec; padding: 8px 10px;
  border-radius: 7px; font-size: 14px;
}
.proj:hover { background: rgba(255,255,255,.07); }
.proj.on { background: var(--sea); color: #fff; font-weight: 600; }
.proj .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj .badge {
  background: var(--tide); color: #fff; border-radius: 10px;
  padding: 1px 7px; font-size: 11px; font-weight: 700;
}
.proj .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--foam); }
.new-project input {
  width: 100%; background: rgba(255,255,255,.06); border: 1px dashed #3d566d;
  color: #cfe0ec; padding: 8px 10px; border-radius: 7px; margin-top: 8px; outline: none;
}
.new-project input::placeholder { color: #7d97ad; }
.signout {
  margin-top: auto; background: transparent; border: 1px solid #2e4459;
  color: #97b0c4; padding: 7px; border-radius: 7px; font-size: 13px;
}
.signout:hover { border-color: var(--tide); color: #fff; }

/* ------------------------------------------------------------------ main */
.main { display: flex; flex-direction: column; min-width: 0; }
.head {
  padding: 16px 24px 0; border-bottom: 1px solid var(--line); background: var(--card);
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap;
}
.head h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; }
.note { color: var(--muted); font-size: 13px; margin: 2px 0 12px; }
.tabs { display: flex; gap: 2px; }
.tab {
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  padding: 9px 14px; color: var(--muted); font-size: 14px; font-weight: 500;
}
.tab:hover { color: var(--sea); }
.tab.on { color: var(--sea); border-bottom-color: var(--sea); font-weight: 600; }
.pill {
  background: var(--urgent); color: #fff; border-radius: 9px;
  padding: 0 6px; font-size: 11px; font-weight: 700; margin-left: 4px;
}
.pill:empty { display: none; }

.pane { display: none; flex: 1; min-height: 0; flex-direction: column; }
.pane.on { display: flex; }

/* ------------------------------------------------------------------ chat */
.thread { flex: 1; overflow-y: auto; padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 620px; }
.msg .meta { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.msg .bubble {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 13px; box-shadow: var(--shadow); white-space: pre-wrap; word-break: break-word;
}
.msg.mine { align-self: flex-end; }
.msg.mine .bubble { background: var(--sea); color: #fff; border-color: var(--sea); }
.msg.mine .meta { text-align: right; }
.msg.system .bubble {
  background: #eef5f9; border-style: dashed; color: var(--sea);
  font-size: 13.5px; box-shadow: none;
}
.attach {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 8px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  padding: 7px 11px; border-radius: 8px; color: inherit; text-decoration: none; font-size: 13px;
}
.msg:not(.mine) .attach { background: #f1f6fa; border-color: var(--line); color: var(--sea); }
.attach:hover { text-decoration: underline; }
.attach img { max-width: 260px; border-radius: 6px; display: block; }

.say { display: flex; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--card); }
.say input[type=text], #say-body {
  flex: 1; padding: 11px 14px; border: 1px solid var(--line); border-radius: 22px; outline: none;
}
#say-body:focus { border-color: var(--tide); box-shadow: 0 0 0 3px rgba(44,125,160,.13); }
.say button { background: var(--sea); color: #fff; border: 0; border-radius: 22px; padding: 0 22px; font-weight: 600; }
.say button:hover { background: var(--tide); }
.clip {
  display: grid; place-items: center; width: 42px; border: 1px solid var(--line);
  border-radius: 50%; cursor: pointer; font-size: 17px;
}
.clip:hover { border-color: var(--tide); background: #f1f6fa; }
.upload-status { padding: 0 24px 10px; color: var(--muted); font-size: 13px; min-height: 0; }

/* ----------------------------------------------------------------- queue */
.new-task {
  display: flex; gap: 8px; padding: 16px 24px; border-bottom: 1px solid var(--line);
  background: var(--card); flex-wrap: wrap; align-items: center;
}
.new-task input[type=text], #task-title {
  flex: 1; min-width: 220px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 8px; outline: none;
}
.new-task input[type=date] { padding: 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.urgent { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; }
.new-task button { background: var(--sea); color: #fff; border: 0; border-radius: 8px; padding: 10px 18px; font-weight: 600; }
.new-task button:hover { background: var(--tide); }

.tasks { flex: 1; overflow-y: auto; padding: 18px 24px; display: flex; flex-direction: column; gap: 9px; }
.task {
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--tide);
  border-radius: var(--radius); padding: 13px 15px; box-shadow: var(--shadow);
  display: flex; gap: 12px; align-items: flex-start;
}
.task.urgent { border-left-color: var(--urgent); }
.task.done { opacity: .58; border-left-color: var(--done); }
.task.done .title { text-decoration: line-through; }
.task input[type=checkbox] { margin-top: 3px; width: 17px; height: 17px; cursor: pointer; flex-shrink: 0; }
.task .body { flex: 1; min-width: 0; }
.task .title { font-weight: 600; }
.task .detail { color: var(--muted); font-size: 13.5px; margin-top: 2px; white-space: pre-wrap; }
.task .facts { color: var(--muted); font-size: 12px; margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; }
.task .facts .due { color: var(--urgent); font-weight: 600; }
.task .reply {
  margin-top: 8px; padding: 7px 10px; background: #eef7f5;
  border-left: 2px solid var(--done); border-radius: 5px; font-size: 13.5px;
}
.empty { color: var(--muted); text-align: center; padding: 44px 20px; font-size: 14px; }

/* ------------------------------------------------------- files & gallery */
.drop {
  margin: 18px 24px 0; border: 2px dashed var(--line); border-radius: 12px;
  padding: 24px; text-align: center; display: flex; flex-direction: column; gap: 5px;
  align-items: center; color: var(--muted); background: var(--card); transition: .15s;
}
.drop.over { border-color: var(--tide); background: #eef7fb; }
.drop strong { color: var(--ink); font-size: 15px; }
.drop span { font-size: 13px; }
.browse {
  margin-top: 8px; background: var(--sea); color: #fff; padding: 8px 16px;
  border-radius: 8px; cursor: pointer; font-size: 13.5px; font-weight: 600;
}
.browse:hover { background: var(--tide); }

.cards { flex: 1; overflow-y: auto; padding: 18px 24px; display: flex; flex-direction: column; gap: 9px; }
.filecard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px;
}
.filecard .icon { font-size: 26px; }
.filecard .body { flex: 1; min-width: 0; }
.filecard .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filecard .facts { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.filecard a.dl {
  background: var(--sea); color: #fff; text-decoration: none; padding: 8px 15px;
  border-radius: 8px; font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.filecard a.dl:hover { background: var(--tide); }

.gallery {
  flex: 1; overflow-y: auto; padding: 18px 24px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; align-content: start;
}
.shot {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); cursor: zoom-in;
}
.shot img { width: 100%; height: 145px; object-fit: cover; display: block; background: #eef2f5; }
.shot .cap { padding: 9px 11px; font-size: 12.5px; }
.shot .cap .who { color: var(--muted); font-size: 11.5px; margin-top: 2px; }

.lightbox {
  position: fixed; inset: 0; background: rgba(8,18,28,.92); display: grid;
  place-items: center; z-index: 50; cursor: zoom-out; padding: 34px;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: 100dvh; }
  .rail { flex-direction: row; align-items: center; overflow-x: auto; padding: 10px; gap: 8px; }
  .rail-label, .new-project, .rail-head > div { display: none; }
  .projects { flex-direction: row; }
  .signout { margin: 0; }
  .head { padding: 12px 16px 0; }
  .thread, .tasks, .cards, .gallery { padding: 14px 16px; }
  .say { padding: 10px 16px; }
}
