:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-strong: #f0f3f6;
  --ink: #1f252d;
  --muted: #66717f;
  --line: #d9dee5;
  --line-strong: #c3cad4;
  --teal: #087f8c;
  --teal-soft: #e0f3f4;
  --rose: #b33f62;
  --rose-soft: #f9e6ec;
  --amber: #9b6a00;
  --amber-soft: #f6ead0;
  --green: #237a52;
  --green-soft: #e1f1e9;
  --violet: #6554c0;
  --violet-soft: #ebe8fb;
  --shadow: 0 18px 50px rgba(31, 37, 45, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #ffffff 0, #f6f7f9 300px),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--teal);
}

.app-shell {
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 6px 0 18px;
}

.brand-block {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 2px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.3;
}

h3 {
  margin-bottom: 4px;
  font-size: 15px;
  line-height: 1.35;
}

.subtitle {
  margin-bottom: 0;
  color: var(--muted);
}

.topbar-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 220px;
}

.category-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.category-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(31, 37, 45, 0.04);
  text-align: left;
}

.category-card:hover {
  border-color: rgba(8, 127, 140, 0.45);
  box-shadow: 0 14px 34px rgba(8, 127, 140, 0.08);
}

.category-card.is-active {
  border-color: rgba(8, 127, 140, 0.48);
  background: linear-gradient(180deg, #ffffff, var(--teal-soft));
}

.category-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.category-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.category-count {
  color: var(--teal);
  font-size: 24px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.status-pill,
.last-updated,
.pill,
.mini-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.status-pill.is-ready {
  border-color: rgba(35, 122, 82, 0.28);
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.is-error {
  border-color: rgba(179, 63, 98, 0.24);
  background: var(--rose-soft);
  color: var(--rose);
}

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(31, 37, 45, 0.04);
}

.tab-button,
.segmented button,
.ghost-button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tab-button {
  min-width: 84px;
  padding: 7px 14px;
}

.tab-button.is-active,
.segmented button.is-active {
  background: var(--ink);
  color: #ffffff;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.metric-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(31, 37, 45, 0.04);
}

.metric-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-value {
  display: block;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  overflow-wrap: anywhere;
}

.metric-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) minmax(280px, 360px);
  gap: 16px;
  align-items: start;
}

.insights,
.detail-pane {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.event-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.insight-block,
.detail-card,
.toolbar,
.events-area {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 34px rgba(31, 37, 45, 0.05);
}

.insight-block {
  padding: 14px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.section-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.bar-list {
  display: grid;
  gap: 9px;
}

.bar-item {
  display: grid;
  gap: 5px;
}

.bar-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
}

.bar-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
}

.bar-fill {
  width: var(--bar-width, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #48a67c);
}

.bar-list.compact .bar-fill {
  background: linear-gradient(90deg, var(--rose), var(--amber));
}

.chip-cloud,
.tag-row,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.chip {
  display: inline-flex;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.chip.teal {
  background: var(--teal-soft);
  color: var(--teal);
}

.chip.rose {
  background: var(--rose-soft);
  color: var(--rose);
}

.chip.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.chip.violet {
  background: var(--violet-soft);
  color: var(--violet);
}

.list-area {
  min-width: 0;
}

.toolbar {
  display: grid;
  gap: 12px;
  padding: 14px;
  margin-bottom: 10px;
}

label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

input,
select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus,
button:focus-visible {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 127, 140, 0.14);
}

.search-box input {
  min-height: 44px;
  font-size: 15px;
}

.control-row,
.toolbar-actions {
  display: grid;
  gap: 10px;
  align-items: end;
}

.control-row {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.toolbar-actions {
  grid-template-columns: minmax(110px, 0.8fr) minmax(170px, 1.1fr) minmax(132px, auto) auto auto;
}

.toggle-control {
  display: flex;
  align-items: center;
  min-height: 38px;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
}

.toggle-control input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--teal);
}

.toggle-control span {
  color: var(--ink);
  font-size: 13px;
}

.segmented {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  min-height: 38px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-strong);
}

.segmented button {
  min-width: 56px;
  min-height: 28px;
  padding: 4px 9px;
}

.ghost-button {
  padding: 8px 12px;
  border-color: var(--line-strong);
  background: #ffffff;
}

.ghost-button:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.result-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.job-results,
.event-results {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.job-card,
.event-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(31, 37, 45, 0.035);
}

.job-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.job-card:hover,
.event-card:hover,
.table-wrap tr[data-id]:hover {
  border-color: rgba(8, 127, 140, 0.45);
  box-shadow: 0 14px 34px rgba(8, 127, 140, 0.08);
}

.job-card.is-selected {
  border-color: var(--teal);
  box-shadow: 0 14px 34px rgba(8, 127, 140, 0.12);
}

.job-main,
.job-side,
.event-card {
  min-width: 0;
}

.job-title {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.job-company {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.job-summary,
.event-summary,
.detail-body {
  margin-bottom: 0;
  color: #3d4652;
  overflow-wrap: anywhere;
}

.job-meta,
.event-meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  margin-top: 8px;
}

.job-side {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 8px;
  width: 170px;
  text-align: right;
}

.salary {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.source-link,
.detail-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 6px;
  background: var(--teal);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.source-link:hover,
.detail-link:hover {
  background: #066a74;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

td {
  color: #34404c;
  font-size: 13px;
  overflow-wrap: anywhere;
}

tr:last-child td {
  border-bottom: 0;
}

.detail-card {
  padding: 16px;
}

.detail-kicker {
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.detail-title {
  margin-bottom: 6px;
  font-size: 18px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.detail-company {
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.detail-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 16px;
}

.events-area {
  padding: 14px;
}

.events-toolbar {
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(150px, 220px));
  align-items: end;
  box-shadow: none;
}

.event-card {
  margin-top: 8px;
}

.hide {
  display: none !important;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  }

  .insights {
    position: static;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-pane {
    top: 10px;
  }
}

@media (max-width: 900px) {
  .app-shell {
    padding: 18px;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .topbar-meta {
    justify-content: flex-start;
  }

  .metric-grid,
  .insights,
  .event-insights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-pane {
    position: static;
  }

  .control-row,
  .toolbar-actions,
  .event-insights,
  .events-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 14px;
  }

  .metric-grid,
  .insights,
  .event-insights,
  .category-overview,
  .control-row,
  .toolbar-actions,
  .events-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .tabs {
    width: 100%;
  }

  .tab-button {
    flex: 1;
  }

  .job-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .job-side {
    width: 100%;
    justify-items: start;
    text-align: left;
  }

  .source-link,
  .detail-link {
    width: 100%;
  }
}
