/* Guild officer's page inside the resident conversation card: a wider card, the membership card
   with the wallet, the quest / guild info / mall tabs, and quest cards with picture, item chips,
   reward chips and the deliver button. Same parchment, wood and leaf-green language as the card. */
.city-npc-dialog[data-npc=guild-officer]{width:min(1000px,calc(100vw - 28px))}
.city-npc-dialog[data-npc=guild-officer] .city-npc-panel{max-height:min(88dvh,680px)}
.guild-panel{display:flex;flex-direction:column;gap:12px;margin-top:14px}
/* Membership card. */
.guild-card{display:grid;grid-template-columns:54px minmax(0,1fr) auto;gap:6px 14px;align-items:center;padding:12px 16px;border:2px solid #d9bd85;border-radius:16px;background:radial-gradient(ellipse at 100% 0,#fff8e6,#0000 55%),linear-gradient(135deg,#fdf5e2,#f0dfbb);box-shadow:inset 0 0 0 3px #fffaf0,0 3px 0 #d8c39a}
.guild-card[data-member=true]{border-color:#7fb489;background:radial-gradient(ellipse at 100% 0,#f3fbef,#0000 55%),linear-gradient(135deg,#f4f8e8,#dfebc8)}
.guild-seal{display:grid;place-items:center;width:54px;height:54px;border:3px solid var(--npc-gold);border-radius:50%;background:linear-gradient(#83582f,#4a2d18);color:#ffe7a8;font:900 24px/1 Tahoma,sans-serif;box-shadow:0 3px 0 #34200f,inset 0 0 0 2px #5d3b22}
.guild-card[data-member=true] .guild-seal{background:linear-gradient(#4b8559,#264c33);color:#fff6df;box-shadow:0 3px 0 var(--npc-green-dark),inset 0 0 0 2px #3a6d4a}
.guild-card-copy{display:flex;flex-direction:column;gap:2px;min-width:0}
.guild-card-title{font-size:15px;font-weight:900;color:#5a4128}
.guild-card .city-npc-membership{margin:0;font-size:13px}
.guild-wallet{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}
.city-npc-dialog .guild-join{align-self:center;white-space:nowrap}
/* Tabs. */
.guild-tabs{display:flex;gap:6px;padding:4px;border:1px solid #dcc39a;border-radius:14px;background:#f6ebd3}
.city-npc-dialog .guild-tab{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;padding:8px 12px;border:1px solid #0000;border-radius:10px;background:none;box-shadow:none;color:#7a5f33}
.city-npc-dialog .guild-tab[aria-selected=true]{border-color:var(--npc-gold);background:linear-gradient(#4b8559,#2f5b3e 55%,#264c33);color:#fff6df;text-shadow:0 1px 0 #152a1c;box-shadow:inset 0 1px 0 #7fb489,0 2px 0 var(--npc-green-dark)}
.guild-tab-count{min-width:20px;padding:0 6px;border-radius:999px;background:#e8d7b2;color:#5a4128;font-size:11px;line-height:18px}
.city-npc-dialog .guild-tab[aria-selected=true] .guild-tab-count{background:#ffe7a8;color:#264c33}
/* Quest cards. */
.guild-quests{display:flex;flex-direction:column;gap:10px}
.city-npc-dialog .guild-quest{display:grid;grid-template-columns:92px minmax(0,1fr) 168px;gap:6px 16px;align-items:start;margin:0;padding:14px 16px}
.city-npc-dialog .guild-quest[data-completed=true]{background:#eef3e4;border-color:#c5d4b0}
.guild-quest-art{display:grid;place-items:center;width:92px;height:92px;border:1px solid #dcc39a;border-radius:14px;background:radial-gradient(circle at 50% 35%,#fffaf0,#ecdcc0);overflow:hidden}
.guild-quest-art>img{width:88%;height:88%;object-fit:contain;filter:drop-shadow(0 3px 3px #1a2a1f33)}
.guild-quest-pile{display:flex;align-items:center;justify-content:center;gap:0}
.guild-quest-pile img{width:44px;height:44px;object-fit:contain;margin:0 -8px;filter:drop-shadow(0 2px 2px #1a2a1f40)}
.guild-quest-pile img:nth-child(2){transform:translateY(-6px) scale(1.1);z-index:1}
.guild-quest-mark{font-size:32px;color:#c9a55a}
.guild-quest-copy{display:flex;flex-direction:column;gap:6px;min-width:0}
.city-npc-dialog .guild-quest h3{margin:0;font-size:16px;color:#4a3526}
.city-npc-dialog .guild-quest .guild-quest-text{margin:0;font-size:12.5px;line-height:1.6;color:#6b5844}
.guild-quest-group{display:flex;flex-direction:column;gap:5px}
.guild-label{font-size:11px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:#8b7358}
.guild-chips{display:flex;flex-wrap:wrap;gap:6px}
.guild-chip{display:inline-flex;align-items:center;gap:6px;min-height:28px;padding:3px 10px 3px 6px;border:1px solid #dcc39a;border-radius:999px;background:#fffbf2;font-size:12.5px;font-weight:700;color:#5a4128;line-height:1.2}
.guild-chip img{width:22px;height:22px;object-fit:contain}
.guild-chip-coins{border-color:#e6c46a;background:#fff4cc;color:#8a5a14}
.guild-chip-points{border-color:#a9c6ea;background:#e8f1fd;color:#2f5688}
.guild-chip-xp{border-color:#a8cfa9;background:#e6f4e4;color:#2f6b45}
.guild-chip-coins::before,.guild-chip-points::before,.guild-chip-xp::before{content:'';width:18px;height:18px;border-radius:50%;flex:none}
.guild-chip-coins::before{background:radial-gradient(circle at 35% 35%,#fff1b0,#e0a92a 60%,#a8741a);box-shadow:inset 0 0 0 2px #f7d977}
.guild-chip-points::before{background:radial-gradient(circle at 35% 35%,#dbeeff,#4f8fd6 60%,#2c5a94);box-shadow:inset 0 0 0 2px #9ec5f2}
.guild-chip-xp::before{background:radial-gradient(circle at 35% 35%,#e8ffd8,#6bb35a 60%,#2f6b45);box-shadow:inset 0 0 0 2px #b6e0a4}
.guild-chip[data-enough=false]{border-color:#e3b3a3;background:#fdf0ea;color:#9a3f2b}
.guild-chip[data-enough=true]{border-color:#a8cfa9;background:#eef7ea}
.guild-have{font-size:10.5px;font-weight:700;color:inherit;opacity:.85}
/* Item 33: "ดรอปจาก หมูป่า · หมาป่า" on its own line inside an item chip. */
.guild-chip:has(.guild-source){flex-wrap:wrap;border-radius:14px;max-width:100%}
.guild-chip .guild-source{flex-basis:100%;font-size:10.5px;font-weight:600;color:#7a5f3d;opacity:.9;overflow-wrap:anywhere;white-space:normal;padding-left:2px}
.guild-quest-action{display:flex;flex-direction:column;align-items:stretch;gap:5px;align-self:center}
.city-npc-dialog .guild-deliver{width:100%;min-height:46px;padding:10px 12px;border-color:var(--npc-gold);background:linear-gradient(#4b8559,#2f5b3e 55%,#264c33);color:#fff6df;text-shadow:0 1px 0 #152a1c;box-shadow:inset 0 1px 0 #7fb489,0 3px 0 var(--npc-green-dark)}
.city-npc-dialog .guild-deliver:hover:not(:disabled){background:linear-gradient(#56946a,#356747 55%,#2a5539);border-color:#f0c75e}
.city-npc-dialog .guild-deliver[data-state=locked]{opacity:1;border-color:#d6bd8c;background:linear-gradient(#f4ecda,#e6d8bb);color:#8b7358;text-shadow:none;box-shadow:0 2px 0 #cfb17a}
/* Icons are empty-content backgrounds so the buttons' accessible names stay their text. */
.city-npc-dialog .guild-deliver::before{display:none;content:'';width:14px;height:14px;margin-right:6px;vertical-align:-2px;background:center/contain no-repeat}
.city-npc-dialog .guild-deliver[data-state=locked]::before{display:inline-block;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b7358' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E")}
.city-npc-dialog .guild-deliver[data-state=short]{opacity:1;border-color:#e3b3a3;background:linear-gradient(#fdf3ee,#f3dcd2);color:#9a3f2b;text-shadow:none;box-shadow:0 2px 0 #d9b3a5}
.city-npc-dialog .guild-deliver[data-state=done]{opacity:1;border-color:#b6cfae;background:linear-gradient(#f0f6ea,#dfe9d3);color:#2f6b45;text-shadow:none;box-shadow:0 2px 0 #b9d0ae}
.city-npc-dialog .guild-deliver[data-state=done]::before{display:inline-block;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f6b45' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17.5 19 7'/%3E%3C/svg%3E")}
.guild-quest-repeat{font-size:11px;text-align:center;color:#8b7358}
.guild-empty{margin:0;padding:24px 16px;border:1px dashed #dcc39a;border-radius:12px;text-align:center;font-size:13px;color:#8b7358}
/* Guild info tab. */
.guild-info{padding:14px 16px;border:1px solid #dcc9a0;border-radius:12px;background:#fffdf7;box-shadow:0 2px 0 #e3d0a8}
.city-npc-dialog .guild-info h3{margin:0 0 6px;font-size:17px;color:#4a3526}
.city-npc-dialog .guild-info-text{margin:6px 0;font-size:12.5px;line-height:1.7;color:#6b5844}
.guild-info-rows{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 14px;margin:10px 0;font-size:13px}
.guild-info-rows dt{font-weight:800;color:#8b7358}.guild-info-rows dd{margin:0;color:#4a3526;font-weight:700}
/* Guild rank (item 25): the badge (uploaded picture or the rank letter on its colour), the merit line with
   the progress to the next rank, the drop warning, the reward chip and the ladder in the info tab. */
.guild-rank-badge{display:inline-grid;place-items:center;min-width:22px;height:22px;padding:0 5px;border:1.5px solid #1d2b22;border-radius:6px;background:var(--rank-color,#8a8f84);color:#fffdf2;font:900 13px/1 Tahoma,sans-serif;text-shadow:0 1px 0 #1d2b22,0 0 2px #1d2b22;box-sizing:border-box;vertical-align:middle}
.guild-rank-badge>img{width:100%;height:100%;object-fit:contain}
.guild-rank-badge:has(>img){padding:0;border:0;background:none;width:22px}
.guild-rank-seal{width:54px;height:54px;min-width:54px;border:3px solid var(--npc-gold);border-radius:14px;font-size:26px;box-shadow:0 3px 0 #34200f,inset 0 0 0 2px #fff4}
.guild-rank-seal:has(>img){width:54px;border:0;box-shadow:none}
.guild-rank{display:flex;flex-direction:column;gap:3px;margin-top:6px}
.guild-rank-line{margin:0;font-size:13px;font-weight:800;color:#2f5b3e}
.guild-rank-progress{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px}
.guild-rank-next{font-size:11.5px;font-weight:800;color:#6b5844}
.guild-rank-max{font-size:12px;font-weight:800;color:#8a5a14}
.guild-rank-bar{flex:1 1 140px;max-width:260px;height:8px;border-radius:999px;background:#e5d8b8;box-shadow:inset 0 1px 2px #0002;overflow:hidden}
.guild-rank-fill{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#6bb35a,#d4a72c)}
.guild-rank-need{flex-basis:100%;display:flex;flex-wrap:wrap;gap:2px 10px;font-size:11.5px;color:#8b7358}
.guild-rank-need .is-done{color:#2f6b45;font-weight:700}
.guild-rank-decay{font-size:11.5px;color:#9a3f2b}
.guild-chip-rank{border-color:#d9b46a;background:#fbf0d5;color:#7a4f12}
.guild-chip-rank::before{content:'';width:16px;height:16px;flex:none;border-radius:4px;background:linear-gradient(135deg,#f1d27a,#c08a24);box-shadow:inset 0 0 0 2px #fbe6a8}
/* Item 56: an outfit reward (right to wear); "· มีแล้ว" when already owned. */
.guild-chip-style{border-color:#e0a7c0;background:#fdecf3;color:#8a2d55}
.guild-chip-style::before{content:'👘';font-size:14px;line-height:1;flex:none}
.guild-chip-style[data-owned="true"]{opacity:.72}
.guild-rank-table{width:100%;max-width:420px;margin:6px 0 4px;border-collapse:collapse;font-size:13px}
.guild-rank-table th{padding:4px 8px;text-align:left;font-size:11px;font-weight:800;color:#8b7358;border-bottom:1px solid #e3d0a8}
.guild-rank-table td{padding:4px 8px;color:#4a3526;font-weight:700;border-bottom:1px solid #f0e4c8}
.guild-rank-table tr.is-current td{background:#eef7ea}
/* Hunt and reach quests (item 26): kind badge, target chips with the species picture, progress bar, place line,
   the accept / confirm / in-progress / full button states, the taken-slots strip and closed-quest notes. */
.guild-task-head{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;min-width:0}
.guild-kind{display:inline-block;padding:2px 8px;border:1px solid #c9a55a;border-radius:999px;background:#fbf0d5;font-size:11px;font-weight:800;color:#7a4f12;white-space:nowrap}
.guild-task[data-kind=reach] .guild-kind{border-color:#a9c6ea;background:#e8f1fd;color:#2f5688}
.guild-species-art{display:inline-grid;place-items:center;width:26px;height:26px;flex:none;border-radius:50%;background:#f3e6c8;overflow:hidden}
.guild-species-art canvas{width:100%;height:100%}
.guild-quest-art>.guild-species-art{width:80%;height:80%;border-radius:12px;background:none}
.guild-chip-target{padding-left:3px;flex-wrap:wrap}
.guild-task-bar{display:block;width:100%;max-width:280px;height:8px;border-radius:999px;background:#e5d8b8;box-shadow:inset 0 1px 2px #0002;overflow:hidden}
.guild-task-fill{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#6bb35a,#d4a72c)}
.guild-task-map{font-size:11.5px;color:#8b7358}
.city-npc-dialog .guild-task-place{margin:0;font-size:13px;font-weight:700;color:#4a3526;overflow-wrap:anywhere}
.guild-task-reached{font-size:11.5px;font-weight:800;color:#9a3f2b}
.guild-task-reached[data-reached=true]{color:#2f6b45}
.city-npc-dialog .guild-deliver[data-confirm=true]{border-color:#e0a92a;background:linear-gradient(#f6c453,#d99a1e 55%,#b87a10);color:#2d1d06;text-shadow:none;font-size:12.5px}
.city-npc-dialog .guild-deliver[data-state=progress],.city-npc-dialog .guild-deliver[data-state=full]{opacity:1;border-color:#d6bd8c;background:linear-gradient(#f4ecda,#e6d8bb);color:#6b5844;text-shadow:none;box-shadow:0 2px 0 #cfb17a}
.city-npc-dialog .guild-limits{margin:0;padding:6px 12px;border:1px solid #dcc39a;border-radius:10px;background:#fffbf2;font-size:12.5px;font-weight:800;color:#5a4128}
.city-npc-dialog .guild-limits[data-full=true]{border-color:#e3b3a3;background:#fdf0ea;color:#9a3f2b}
.city-npc-dialog .guild-cancelled{margin:0;padding:6px 12px;border:1px dashed #e3b3a3;border-radius:10px;background:#fdf6f2;font-size:12.5px;color:#9a3f2b}
/* Footer. */
.city-npc-dialog .guild-mall{border-color:var(--npc-gold);background:linear-gradient(#fff4cc,#f3dd9a);color:#6b4a12;box-shadow:0 2px 0 #c9a55a}
.city-npc-dialog .guild-mall::before{content:'';display:inline-block;width:14px;height:14px;margin-right:7px;vertical-align:-2px;background:center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 22 12 12 22 2 12z' fill='%23a8741a'/%3E%3Cpath d='M12 7 17 12 12 17 7 12z' fill='%23ffe7a8'/%3E%3C/svg%3E")}
/* Phones: one column per quest, actions stacked. */
@media(max-width:600px){
 .city-npc-dialog .guild-quest{grid-template-columns:72px minmax(0,1fr);gap:6px 12px;padding:12px}
 .guild-quest-art{width:72px;height:72px}
 .guild-quest-action{grid-column:1/-1}
 .guild-card{grid-template-columns:44px minmax(0,1fr);padding:10px 12px}
 .guild-seal{width:44px;height:44px;font-size:20px}
 .guild-rank-seal,.guild-rank-seal:has(>img){width:44px;min-width:44px;height:44px;font-size:21px}
 .city-npc-dialog .guild-join{grid-column:1/-1}
 .city-npc-dialog .guild-tab{padding:8px 6px;font-size:12.5px;gap:5px}
}
@media(max-height:500px) and (min-width:601px){
 .city-npc-dialog[data-npc=guild-officer] .city-npc-panel{max-height:calc(100dvh - 58px)}
 .city-npc-dialog .guild-quest{grid-template-columns:72px minmax(0,1fr) 150px;padding:10px 12px}
 .guild-quest-art{width:72px;height:72px}
}
/* Item 47: an item chip's name takes the rarity ink colour; border/background stay for data-enough. */
.guild-chip-item[data-rarity]>span{color:var(--rarity-ink)}
