:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --ink: #1e2124;
  --muted: #5f6670;
  --accent: #1f4e46;
  --accent-ink: #ffffff;
  --line: #e3e1db;
  --warn-bg: #fdf3d7;
  --warn-line: #e8d190;
  --danger: #a03030;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

main {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

header.site {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

header.site h1 { font-size: 1.35rem; margin: 0; letter-spacing: 0.01em; }

.lang-toggle button {
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
}
.lang-toggle button.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
p, li { font-size: 0.95rem; }
p.muted, span.muted { color: var(--muted); font-size: 0.88rem; }

label { display: block; font-weight: 600; font-size: 0.9rem; margin: 1rem 0 0.35rem; }

textarea, input[type="text"], input[type="password"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  background: #fcfcfb;
}
textarea { min-height: 11rem; resize: vertical; }
textarea:focus, input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }

button.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.4rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1.25rem;
}
button.primary:disabled { opacity: 0.5; cursor: not-allowed; }

a.button-secondary {
  display: inline-block;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  text-decoration: none;
  margin-top: 0.75rem;
}
a.button-secondary:hover { background: var(--accent); color: var(--accent-ink); }

button.secondary {
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.9rem;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}
button.danger { border-color: var(--danger); color: var(--danger); }

.notice {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  font-size: 0.92rem;
  margin: 1rem 0;
}

.code-box {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  background: #f0efe9;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin: 0.4rem 0 0.8rem;
  user-select: all;
  word-break: break-all;
}

.error { color: var(--danger); font-size: 0.9rem; margin-top: 0.75rem; }
.hidden { display: none; }

.thread { display: flex; flex-direction: column; gap: 0.75rem; margin: 1rem 0; }
.msg { border-radius: 10px; padding: 0.75rem 1rem; max-width: 85%; white-space: pre-wrap; font-size: 0.95rem; }
.msg.reporter { background: #eef1ee; align-self: flex-start; }
.msg.unit { background: var(--accent); color: #fff; align-self: flex-end; }
.msg .meta { display: block; font-size: 0.75rem; opacity: 0.7; margin-top: 0.35rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #f4f3ef; }
.pill { display: inline-block; border-radius: 999px; padding: 0.1rem 0.6rem; font-size: 0.78rem; font-weight: 600; }
.pill.new { background: #fdeaea; color: #a03030; }
.pill.in_progress { background: #fdf3d7; color: #7a5d00; }
.pill.closed { background: #e8efe9; color: #2e5a3c; }
.pill.overdue { background: #a03030; color: #fff; }

footer { margin-top: 2rem; font-size: 0.8rem; color: var(--muted); }
footer a { color: var(--muted); }
a { color: var(--accent); }
