:root {
    --bg: #f5f6fa;
    --card: #ffffff;
    --dark: #12141c;
    --accent: #4657ff;
    --accent-light: #6472ff;
    --text: #1a1c25;
    --text-dim: #6b6f80;
    --border: #e4e5ec;
    --green: #1a7d3f;
    --red: #c23824;
    --radius: 12px;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
}
h1, h2 { margin: 0; }
button { font-family: inherit; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 22px; border-radius: 8px; font-weight: 700; font-size: 14.5px;
    border: 2px solid transparent; cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-light); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text-dim); }
.btn-outline:hover { background: #fff; }
.btn-danger { background: #fdeceb; color: var(--red); }
.btn-danger:hover { background: #fbdad7; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }

.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-field[hidden] { display: none; }
.form-field label { font-size: 13.5px; font-weight: 700; color: var(--text-dim); }
.form-field input, .form-field textarea, .form-field select {
    padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 8px;
    font-size: 14.5px; font-family: inherit; background: var(--bg);
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
    outline: none; border-color: var(--accent); background: #fff;
}
.form-field textarea { resize: vertical; min-height: 80px; }
.form-check { display: flex; align-items: center; gap: 8px; }
.form-msg { margin-top: 10px; padding: 10px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; display: none; }
.form-msg.show { display: block; }
.form-msg.ok { background: #e8f7ee; color: var(--green); }
.form-msg.err { background: #fdeceb; color: #c23824; }

.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 20% 20%, #1c2030, var(--dark) 60%); }
.login-wrap { width: 100%; max-width: 380px; padding: 24px; }
.login-card { background: #fff; border-radius: 16px; padding: 36px 32px; box-shadow: 0 30px 60px rgba(0,0,0,.35); }
.login-brand { text-align: center; font-weight: 800; font-size: 19px; margin-bottom: 6px; }
.login-sub { text-align: center; color: var(--text-dim); font-size: 14px; margin-bottom: 26px; }

.container { max-width: 1080px; margin: 0 auto; padding: 32px 24px 60px; }
.topbar { background: var(--dark); color: #fff; }
.topbar-inner { max-width: 1080px; margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; }
.topbar-brand { font-weight: 800; font-size: 16px; }
.topbar-actions { display: flex; gap: 10px; }
.topbar .btn-outline { border-color: rgba(255,255,255,.2); color: #fff; }
.topbar .btn-outline:hover { background: rgba(255,255,255,.08); }

.section-head { margin-bottom: 24px; }
.section-head h1 { font-size: 24px; margin-bottom: 6px; }
.section-head p { color: var(--text-dim); margin: 0; }

.notice {
    max-width: 1080px; margin: 16px auto 0; padding: 14px 18px; background: #fff4e8; border: 1px solid #ffd8ac;
    border-radius: 10px; color: #a15c07; font-size: 14px; font-weight: 600;
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.notice[hidden] { display: none; }
.notice button { border: none; cursor: pointer; font-weight: 700; border-radius: 8px; padding: 6px 12px; font-size: 13px; }
.notice #noticeChangeBtn { background: var(--accent); color: #fff; }
.notice-dismiss { background: transparent !important; color: #a15c07 !important; margin-left: auto; font-size: 18px !important; line-height: 1; padding: 2px 8px !important; }

.box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.box-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.box-head h2 { font-size: 17px; }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.project-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; }
.project-card h3 { font-size: 16px; margin: 0 0 6px; }
.project-card .path { font-size: 13px; color: var(--accent); font-family: monospace; margin-bottom: 10px; word-break: break-all; }
.project-card .desc { font-size: 13.5px; color: var(--text-dim); margin-bottom: 14px; flex: 1; }
.status-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; margin-bottom: 12px; width: fit-content; }
.status-pill.ready { background: #e8f7ee; color: var(--green); }
.status-pill.in_progress { background: #fff4e8; color: #a15c07; }
.status-pill.review { background: #eef0ff; color: var(--accent); }
.project-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.lock-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; margin-bottom: 12px; background: #f1f2f6; color: var(--text-dim); }
.lock-pill.on { background: #eef0ff; color: var(--accent); }

.access-lead { color: var(--text-dim); font-size: 14px; line-height: 1.55; margin: -6px 0 16px; }
.access-pass { display: flex; align-items: baseline; gap: 12px; padding: 14px 16px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); }
.access-pass span { font-size: 13px; color: var(--text-dim); font-weight: 700; }
.access-pass b { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 22px; letter-spacing: .04em; user-select: all; }
.access-link { font-size: 13px; color: var(--accent); font-family: monospace; margin: 10px 2px 4px; word-break: break-all; }
.access-actions { justify-content: flex-start; flex-wrap: wrap; margin-top: 14px; }
.access-note { font-size: 12.5px; color: var(--text-dim); margin: 10px 0 0; }
.muted { color: var(--text-dim); }

.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(18,20,28,.55);
    z-index: 200; padding: 40px 20px; overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal-box { position: relative; background: #fff; border-radius: 16px; max-width: 480px; width: 100%; margin: auto; padding: 26px; }
.modal-box h3 { font-size: 18px; font-weight: 800; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

@media (max-width: 640px) {
    .topbar-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
    .container { padding: 24px 16px 40px; }
}
