:root {
  color-scheme: dark;
  --bg: #111312;
  --panel: #1b1f1d;
  --panel-raised: #222724;
  --field: #121514;
  --ink: #f4f1ea;
  --muted: #aaa39a;
  --line: #343b37;
  --accent: #34d399;
  --accent-ink: #07110d;
  --accent-soft: #18362c;
  --danger: #ff6b8a;
  --danger-soft: #351922;
  --focus: #f3b43f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

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

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px 32px;
}

.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0 20px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 2rem;
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 1.08rem;
}

.signout-link {
  max-width: 44%;
  overflow: hidden;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-panel,
.history-section,
.login-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.32);
}

.entry-panel {
  padding: 16px;
}

.history-section {
  margin-top: 16px;
  padding: 14px;
}

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

label {
  display: block;
  margin: 14px 0 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: #746e67;
}

input {
  min-height: 48px;
  padding: 0 13px;
}

textarea {
  min-height: 104px;
  resize: vertical;
  padding: 12px 13px;
}

input:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  border-color: var(--focus);
  outline: 3px solid rgba(245, 158, 11, 0.24);
  outline-offset: 2px;
}

.date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary-action,
.secondary-action,
.ghost-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary-action {
  width: 100%;
  margin-top: 16px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.secondary-action {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel-raised);
  color: var(--ink);
}

.ghost-button {
  min-width: 76px;
  border: 1px solid #28634f;
  background: var(--accent-soft);
  color: #9df3cf;
}

.form-status {
  min-height: 1.5em;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-status.error {
  color: var(--danger);
}

.event-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-raised);
}

.event-name {
  margin: 0 0 4px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.event-time {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.event-note {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: #d2ccc4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.delete-button {
  width: 40px;
  height: 40px;
  border: 1px solid #65303f;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
}

.empty-state {
  margin: 10px 0 0;
  color: var(--muted);
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
}

.login-panel {
  width: min(100%, 390px);
  padding: 20px;
}

.login-panel h1 {
  margin-bottom: 8px;
}

.login-copy {
  margin-bottom: 18px;
  color: var(--muted);
}

.notice {
  padding: 10px 12px;
  border: 1px solid #65303f;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
}

.setup-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-raised);
  color: var(--muted);
}

.setup-box p {
  margin-bottom: 4px;
}

code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
}

@media (min-width: 680px) {
  .app-shell {
    padding-top: 34px;
  }

  h1 {
    font-size: 2.35rem;
  }

  .entry-panel,
  .history-section {
    padding: 20px;
  }
}
