:root {
  --navy: #1f3864;
  --navy-dark: #142845;
  --grey: #595959;
  --bg: #f4f6f9;
  --error: #b3261e;
  --success: #146c2e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: #1a1a1a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: white;
  border-bottom: 1px solid #e2e6ec;
}

.brand { display: flex; align-items: baseline; gap: 8px; }
.brand-mark { color: var(--navy); font-size: 20px; font-weight: 700; }
.brand-mark-img { height: 30px; width: auto; }
.brand-name { color: var(--navy); font-size: 18px; font-weight: 600; letter-spacing: 0.5px; }

.link-btn {
  background: none;
  border: none;
  color: var(--grey);
  cursor: pointer;
  font-size: 14px;
  text-decoration: underline;
}

.card {
  max-width: 560px;
  margin: 48px auto;
  background: white;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.04);
  width: 90%;
}

.auth-card {
  margin-top: 15vh;
  text-align: center;
}
.auth-card .brand { justify-content: center; margin-bottom: 8px; }

h1 { color: var(--navy); font-size: 24px; margin: 0 0 8px; }
.subtitle { color: var(--grey); font-size: 15px; margin: 0 0 24px; }

.dropzone {
  border: 2px dashed #c7cede;
  border-radius: 10px;
  padding: 40px 20px;
  text-align: center;
  transition: all 0.15s ease;
}
.dropzone.dragover { border-color: var(--navy); background: #eef2f8; }
.dropzone p { margin: 6px 0; color: var(--grey); }
.hint { font-size: 12px; }

.file-label {
  display: inline-block;
  margin: 8px 0;
  padding: 10px 20px;
  background: var(--navy);
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
.file-label:hover { background: var(--navy-dark); }

.file-info {
  margin-top: 20px;
  padding: 16px;
  background: #f8f9fb;
  border-radius: 8px;
}
#fileName { font-weight: 600; word-break: break-all; }

.format-choice { margin: 12px 0; display: flex; gap: 20px; font-size: 14px; }

#processBtn {
  width: 100%;
  padding: 12px;
  background: var(--navy);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  margin-top: 8px;
}
#processBtn:hover { background: var(--navy-dark); }
#processBtn:disabled { opacity: 0.6; cursor: not-allowed; }

.status {
  margin-top: 16px;
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
  background: #eef2f8;
}
.status.error { background: #fdecea; color: var(--error); }
.status.success { background: #e9f7ee; color: var(--success); }
.status.loading { background: #eef2f8; color: var(--navy); }

.privacy-note { font-size: 12px; color: #8a8f98; margin-top: 28px; text-align: center; }

form { display: flex; flex-direction: column; gap: 12px; }
input[type="password"] {
  padding: 12px;
  border: 1px solid #c7cede;
  border-radius: 6px;
  font-size: 15px;
}
button[type="submit"] {
  padding: 12px;
  background: var(--navy);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
}
button[type="submit"]:hover { background: var(--navy-dark); }

.error { color: var(--error); font-size: 14px; }
.fineprint { font-size: 12px; color: #8a8f98; margin-top: 24px; }

/* ---- Additions for the Tech Notes page ---- */

.nav-tabs { display: flex; gap: 6px; margin-left: 20px; }
.nav-tabs a {
  font-size: 13px; font-weight: 600; color: var(--grey); text-decoration: none;
  padding: 6px 12px; border-radius: 6px;
}
.nav-tabs a.active { background: #eef2f8; color: var(--navy); }
.nav-tabs a:hover:not(.active) { background: #f4f6f9; }

.wide-card { max-width: 920px; }

.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  display: flex; align-items: center; gap: 6px; background: #eef2f8; color: var(--navy);
  font-size: 12.5px; font-weight: 600; padding: 6px 10px 6px 12px; border-radius: 99px;
}
.chip button { background: none; border: none; color: var(--navy); opacity: .6; cursor: pointer; font-size: 12px; }
.chip button:hover { opacity: 1; }

.add-row { display: flex; gap: 8px; margin-bottom: 6px; }
.add-row input[type="text"] {
  flex: 1; padding: 9px 11px; border: 1px solid #c7cede; border-radius: 6px; font-size: 13.5px;
}
.btn-ghost {
  background: none; border: 1px solid #c7cede; color: var(--grey); border-radius: 6px;
  padding: 8px 13px; font-weight: 600; font-size: 12.5px; cursor: pointer;
}
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); }

.section-title { font-size: 15px; font-weight: 700; color: var(--navy); margin: 0 0 4px; }
.section-sub { color: var(--grey); font-size: 12.5px; margin-bottom: 14px; }

.note-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border: 1px solid #e2e6ec; border-radius: 9px; padding: 13px 16px; margin-bottom: 10px;
  background: #fbfcfd; cursor: pointer;
}
.note-row:hover { border-color: var(--navy); }
.note-row .title { font-weight: 600; font-size: 13.5px; }
.note-row .meta { font-size: 11.5px; color: #8a8f98; margin-top: 2px; }
.tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; }
.tag.ok { background: #e9f7ee; color: var(--success); }
.tag.warn { background: #fdf3e0; color: #a5730a; }
.tag.err { background: #fdecea; color: var(--error); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.split h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: #8a8f98; margin: 0 0 8px; }
.scroll-box {
  border: 1px solid #e2e6ec; border-radius: 9px; background: #fbfcfd; padding: 14px 16px;
  height: 420px; overflow-y: auto; font-size: 13px; white-space: pre-wrap; line-height: 1.6;
}
textarea.reformatted-box {
  width: 100%; height: 420px; border: 1px solid #e2e6ec; border-radius: 9px; padding: 14px 16px;
  font-family: inherit; font-size: 13px; line-height: 1.6; resize: vertical; background: #fbfcfd;
}
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.caveat { font-size: 11px; color: #8a8f98; border-left: 2px solid #e2e6ec; padding-left: 10px; margin-top: 12px; }
.caveat.warn { border-color: #a5730a; color: #a5730a; }
.caveat.ok { border-color: var(--success); color: var(--success); }
.back-link { display: inline-block; margin-bottom: 12px; font-size: 12.5px; color: var(--navy); cursor: pointer; text-decoration: underline; background: none; border: none; padding: 0; }

/* ---- Landing / tool-chooser page ---- */
.chooser-wrap { max-width: 800px; margin: 64px auto; padding: 0 20px; width: 90%; }
.chooser-title { color: #1a1a1a; font-size: 26px; font-weight: 700; margin: 0 0 28px; text-align: center; }
.chooser-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 640px) { .chooser-grid { grid-template-columns: 1fr; } }

.tool-card {
  display: block; text-decoration: none; border-radius: 14px; padding: 32px 26px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.06);
  transition: transform .12s ease, box-shadow .12s ease;
}
.tool-card:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.1), 0 14px 32px rgba(0,0,0,0.1); }

.tool-card--kairyu { background: #ffffff; border: 1px solid #e2e6ec; }
.tool-card--kairyu .tool-card-mark {
  width: 46px; height: 46px; border-radius: 10px; background: #1f3864; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; margin-bottom: 16px;
}
.tool-card--kairyu .tool-card-name { color: #1f3864; }

.tool-card--techscribe { background: #0B1E3D; border: 1px solid #0B1E3D; }
.tool-card-mark-img { width: 46px; height: 46px; border-radius: 10px; margin-bottom: 16px; display: block; object-fit: contain; }
.tool-card--techscribe .tool-card-name { color: #38DDF0; }
.tool-card--techscribe .tool-card-desc { color: rgba(255,255,255,0.72); }

.tool-card-name { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.tool-card-desc { font-size: 13.5px; color: #595959; line-height: 1.55; }

/* Small "back to tools" link used in both app headers */
.brand-home-link { font-size: 13px; font-weight: 600; color: var(--grey); text-decoration: none; margin-left: 18px; padding: 6px 10px; border-radius: 6px; }
.brand-home-link:hover { background: #f4f6f9; color: var(--navy); }

/* TechScribe page's own header identity (distinct from KaiRyu's navy) */
.topbar--techscribe { background: #0B1E3D; border-bottom: 1px solid #0B1E3D; }
.topbar--techscribe .ts-brand-name { color: #38DDF0; font-size: 18px; font-weight: 700; letter-spacing: 0.3px; }
.topbar--techscribe .ts-brand-mark { height: 30px; width: 30px; border-radius: 7px; }
.topbar--techscribe .brand-home-link { color: rgba(255,255,255,0.6); }
.topbar--techscribe .brand-home-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.topbar--techscribe .link-btn { color: rgba(255,255,255,0.6); }
.topbar--techscribe .link-btn:hover { color: #fff; }

/* ---- 4-tool chooser grid ---- */
.chooser-wrap { max-width: 1000px; }
.chooser-grid--4 { grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .chooser-grid--4 { grid-template-columns: 1fr; } }

.tool-card-mark {
  width: 46px; height: 46px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 15px; margin-bottom: 16px; color: #fff;
}
.tool-card-mark--vendoriq { background: linear-gradient(135deg, #2E3AA8, #1D2570); }
.tool-card-mark--consow { background: linear-gradient(135deg, #8A4B2E, #5C2F17); }

.tool-card--vendoriq { background: #ffffff; border: 1px solid #e2e6ec; }
.tool-card--vendoriq .tool-card-name { color: #2E3AA8; }

.tool-card--consow { background: #ffffff; border: 1px solid #e2e6ec; }
.tool-card--consow .tool-card-name { color: #8A4B2E; }

/* ---- Suite-level topbar for tool sub-pages ("back to IQBaseline") ---- */
.topbar--vendoriq { background: #EEF0FB; border-bottom: 1px solid #DCE0F5; }
.topbar--vendoriq .vq-brand-name { color: #2E3AA8; font-size: 18px; font-weight: 700; }
.topbar--vendoriq .vq-brand-mark {
  width: 30px; height: 30px; border-radius: 7px; background: linear-gradient(135deg, #2E3AA8, #1D2570);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px;
}

.topbar--consow { background: #F7EFE9; border-bottom: 1px solid #EAD9C8; }
.topbar--consow .cs-brand-name { color: #8A4B2E; font-size: 18px; font-weight: 700; }
.topbar--consow .cs-brand-mark {
  width: 30px; height: 30px; border-radius: 7px; background: linear-gradient(135deg, #8A4B2E, #5C2F17);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px;
}

/* ---- Mode toggle (KaiRyu: Resume/JD, VendorIQ tabs, etc.) ---- */
.mode-toggle { display: flex; gap: 6px; margin-bottom: 20px; background: #f4f6f9; border-radius: 8px; padding: 4px; width: fit-content; }
.mode-toggle button { background: none; border: none; padding: 8px 16px; border-radius: 6px; font-size: 13.5px; font-weight: 600; color: var(--grey); cursor: pointer; }
.mode-toggle button.active { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }

.preset-row { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.preset-btn { background: #fff; border: 1px solid #c7cede; color: var(--navy); border-radius: 7px; padding: 8px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.preset-btn:hover { background: #eef2f8; }

/* ---- SupportTriage (teal) ---- */
.tool-card-mark--supporttriage { background: linear-gradient(135deg, #0F766E, #0B4F49); }
.tool-card--supporttriage { background: #ffffff; border: 1px solid #e2e6ec; }
.tool-card--supporttriage .tool-card-name { color: #0F766E; }

.topbar--supporttriage { background: #E9F5F3; border-bottom: 1px solid #CDE7E3; }
.topbar--supporttriage .st-brand-name { color: #0F766E; font-size: 18px; font-weight: 700; }
.topbar--supporttriage .st-brand-mark {
  width: 30px; height: 30px; border-radius: 7px; background: linear-gradient(135deg, #0F766E, #0B4F49);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px;
}

/* Small "paste this OR upload a file" separator, reused wherever a page
   offers both a text box and a file dropzone as alternate inputs. */
.or-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: #8a8f98; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: #e2e6ec; }
