:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #17211f;
  --muted: #60706b;
  --line: #dce3df;
  --accent: #0f7d72;
  --accent-strong: #095b54;
  --warn: #b75e13;
  --ok: #1f8a4c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

.shell {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 20px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 750;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 2rem;
  line-height: 1.1;
}

h2 {
  font-size: 1.05rem;
}

input,
button,
textarea {
  font: inherit;
}

input,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.topbar input {
  min-width: 148px;
  padding: 10px 12px;
}

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

.status-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 9px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.status-item small {
  grid-column: 2;
  color: var(--muted);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warn);
}

.status-item.ok .dot {
  background: var(--ok);
}

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

button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

button:disabled {
  opacity: 0.55;
}

.approval {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  border-radius: 8px;
  background: #eef8f6;
}

.approval[hidden] {
  display: none;
}

.approval p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.92rem;
}

.panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head p {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 3px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.list {
  display: grid;
  gap: 10px;
}

.empty {
  min-height: 92px;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.worklog {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.worklog-check {
  width: 20px;
  height: 20px;
  margin-top: 12px;
}

.worklog-main {
  min-width: 0;
}

.worklog-title {
  display: grid;
  grid-template-columns: minmax(110px, 160px) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.issue,
.description {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
}

.duration {
  color: var(--accent-strong);
  white-space: nowrap;
}

.meta {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.84rem;
}

textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
}

#importUsage {
  margin-top: 10px;
  min-width: 180px;
}

@media (max-width: 680px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .status-grid,
  .actions {
    grid-template-columns: 1fr;
  }

  .approval {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .worklog-title {
    grid-template-columns: 1fr;
  }
}
